Skip to content

Commit 0e2eafe

Browse files
committed
Fix file browser input styles
1 parent 77ee5ab commit 0e2eafe

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/programs/FileBrowser/FileBrowser.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
StyledTopBarButtons,
1313
StyledTopBarPath,
1414
} from "./styles";
15+
import useSystemSettings from "../../stores/systemSettingsStore";
1516

1617
const defaultPath = "/home/user";
1718

@@ -33,6 +34,10 @@ function TopBar({
3334
navForward,
3435
navBack,
3536
}: TopBarProps) {
37+
const [backgroundColor, fontColor] = useSystemSettings((s) => [
38+
s.accentColor,
39+
s.fontColor,
40+
]);
3641
return (
3742
<StyledTopBar>
3843
<StyledTopBarButtons>
@@ -43,6 +48,8 @@ function TopBar({
4348
value={pathSearch}
4449
onChange={onPathInputChange}
4550
onKeyDown={onPathInputSubmit}
51+
backgroundColor={backgroundColor}
52+
color={fontColor}
4653
/>
4754
</StyledTopBar>
4855
);
@@ -53,7 +60,7 @@ function FileBrowser({ path = defaultPath }: FileBrowserProps) {
5360
const appRef = useRef<HTMLDivElement>(null);
5461

5562
const [pathSearch, setPathSearch] = useState<string>(
56-
fs.currentDirectory.path
63+
fs.currentDirectory.path,
5764
);
5865

5966
useEffect(() => {

src/programs/FileBrowser/styles.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,19 @@ export const StyledTopBarButton = styled.div`
4848
}
4949
`;
5050

51-
export const StyledTopBarPath = styled.input`
51+
interface StyledTopBarPathProps {
52+
backgroundColor: string;
53+
color: string;
54+
}
55+
export const StyledTopBarPath = styled.input<StyledTopBarPathProps>`
5256
height: 30px;
5357
width: 100%;
5458
padding: 5px 10px;
5559
border-radius: 50px;
5660
border: none;
5761
box-sizing: border-box;
62+
background-color: ${(props) => props.backgroundColor};
63+
color: ${(props) => props.color};
5864
5965
&:focus-visible {
6066
outline: none;

0 commit comments

Comments
 (0)