Skip to content

Commit

Permalink
feat(Pager): Add previous / next key icons
Browse files Browse the repository at this point in the history
  • Loading branch information
ynhhoJ committed Jan 6, 2025
1 parent 2323aa0 commit 687721b
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions src/components/Pager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,55 @@ export const Pager: React.FC<{
onPrev: () => void;
hasNext: boolean;
hasPrev: boolean;
}> = (props) => {
prevKey?: "l2";
nextKey?: "r2";
}> = ({ currentText, prevKey, hasNext, hasPrev, onNext, onPrev, nextKey }) => {
return (
<Focusable
style={{ ...pager_container, ...focus_panel_no_padding }}
flow-children="horizontal"
>
{prevKey && (
<img
src={`/steaminputglyphs/sd_${prevKey}.svg`}
alt={prevKey}
style={{ opacity: hasPrev ? 1 : 0.5 }}
/>
)}

<DialogButton
style={{
minWidth: "0px",
padding: "10px 10px",
width: "35px",
}}
disabled={!props.hasPrev}
onClick={props.onPrev}
disabled={!hasPrev}
onClick={onPrev}
>
&lt;
</DialogButton>

<div className="title">{props.currentText}</div>
<div className="title">{currentText}</div>

<DialogButton
style={{
minWidth: "0px",
padding: "10px 10px",
width: "35px",
}}
disabled={!props.hasNext}
onClick={props.onNext}
disabled={!hasNext}
onClick={onNext}
>
&gt;
</DialogButton>

{nextKey && (
<img
src={`/steaminputglyphs/sd_${nextKey}.svg`}
alt={nextKey}
style={{ opacity: hasNext ? 1 : 0.5 }}
/>
)}
</Focusable>
);
};

0 comments on commit 687721b

Please sign in to comment.