Skip to content

Commit

Permalink
refactor: remove tailwind gray styles and update zoom controls
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Setch <[email protected]>
  • Loading branch information
setchy committed Sep 20, 2024
1 parent 117b9c2 commit bfb0ae7
Show file tree
Hide file tree
Showing 14 changed files with 195 additions and 214 deletions.
2 changes: 1 addition & 1 deletion src/components/AllRead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const AllRead: FC = () => {
);

return (
<div className="flex flex-1 flex-col items-center justify-center bg-white p-4 text-black dark:bg-gray-dark dark:text-white">
<div className="flex flex-1 flex-col items-center justify-center bg-white p-4 text-black">
<div className="mt-2 mb-5 text-5xl">
<EmojiText text={emoji} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NotificationRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const NotificationRow: FC<INotificationRow> = ({
<div
id={notification.id}
className={cn(
'group flex border-b border-gray-100 bg-white px-3 py-2 hover:bg-gray-100 dark:border-gray-darker dark:bg-gray-dark dark:text-white dark:hover:bg-gray-darker',
'group flex border-b border-gray-100 bg-white px-3 py-2 hover:bg-gray-100',
(isAnimated || animateExit) &&
'translate-x-full opacity-0 transition duration-[350ms] ease-in-out',
(isRead || showAsRead) && Opacity.READ,
Expand Down
20 changes: 10 additions & 10 deletions src/components/__snapshots__/AccountNotifications.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/components/__snapshots__/AllRead.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/components/__snapshots__/NotificationRow.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

100 changes: 52 additions & 48 deletions src/components/settings/AppearanceSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { ipcRenderer, webFrame } from 'electron';
import { type FC, useContext, useEffect, useState } from 'react';

import Badge from '@atlaskit/badge';
import { IconButton } from '@atlaskit/button/new';
import Heading from '@atlaskit/heading';
import MediaServicesZoomInIcon from '@atlaskit/icon/glyph/media-services/zoom-in';
import MediaServicesZoomOutIcon from '@atlaskit/icon/glyph/media-services/zoom-out';
import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
Expand All @@ -10,7 +12,6 @@ import { RadioGroup } from '@atlaskit/radio';
import type { OptionsPropType } from '@atlaskit/radio/types';
import Tooltip from '@atlaskit/tooltip';

import Heading from '@atlaskit/heading';
import { AppContext } from '../../context/App';
import { Theme } from '../../types';
import { setTheme } from '../../utils/theme';
Expand Down Expand Up @@ -62,61 +63,64 @@ export const AppearanceSettings: FC = () => {
options={themeOptions}
defaultValue={settings.theme}
value={settings.theme}
isDisabled={true}
// isDisabled={true}
onChange={(evt) => {
updateSetting('theme', evt.target.value as Theme);
}}
aria-labelledby="theme-label"
/>
</Inline>

<div className="flex items-center mt-3 mb-2 text-sm">
<label
htmlFor="Zoom"
className="mr-3 content-center font-medium text-gray-700 dark:text-gray-200"
>
<Inline space="space.100">
<Text id="theme-label" weight="medium">
Zoom:
</label>
<Tooltip content="Zoom Out" position="bottom">
<IconButton
label="Zoom Out"
icon={MediaServicesZoomOutIcon}
shape="circle"
spacing="compact"
onClick={() =>
zoomPercentage > 0 &&
webFrame.setZoomLevel(zoomPercentageToLevel(zoomPercentage - 10))
}
testId="settings-zoom-out"
/>
</Tooltip>
<span className="flex w-16 h-5 items-center justify-center rounded-none border border-gray-300 bg-transparent text-xs text-gray-700 dark:text-gray-200">
{zoomPercentage.toFixed(0)}%
</span>
<Tooltip content="Zoom In" position="bottom">
<IconButton
label="Zoom In"
icon={MediaServicesZoomInIcon}
shape="circle"
spacing="compact"
onClick={() =>
zoomPercentage < 120 &&
webFrame.setZoomLevel(zoomPercentageToLevel(zoomPercentage + 10))
}
testId="settings-zoom-in"
/>
</Tooltip>
<Tooltip content="Reset Zoom" position="bottom">
<IconButton
label="Reset Zoom"
icon={SelectClearIcon}
shape="circle"
spacing="compact"
onClick={() => webFrame.setZoomLevel(0)}
testId="settings-zoom-reset"
/>
</Tooltip>
</div>
</Text>
<Inline alignBlock="center">
<Tooltip content="Zoom Out" position="bottom">
<IconButton
label="Zoom Out"
icon={MediaServicesZoomOutIcon}
shape="circle"
spacing="compact"
onClick={() =>
zoomPercentage > 0 &&
webFrame.setZoomLevel(
zoomPercentageToLevel(zoomPercentage - 10),
)
}
testId="settings-zoom-out"
/>
</Tooltip>
<Badge max={false}>{zoomPercentage.toFixed(0)}%</Badge>
<Tooltip content="Zoom In" position="bottom">
<IconButton
label="Zoom In"
icon={MediaServicesZoomInIcon}
shape="circle"
spacing="compact"
onClick={() =>
zoomPercentage < 120 &&
webFrame.setZoomLevel(
zoomPercentageToLevel(zoomPercentage + 10),
)
}
testId="settings-zoom-in"
/>
</Tooltip>
<Tooltip content="Reset Zoom" position="bottom">
<IconButton
label="Reset Zoom"
icon={(iconProps) => (
<SelectClearIcon {...iconProps} primaryColor="red" />
)}
shape="circle"
spacing="compact"
onClick={() => webFrame.setZoomLevel(0)}
testId="settings-zoom-reset"
/>
</Tooltip>
</Inline>
</Inline>
</Stack>
);
};
2 changes: 1 addition & 1 deletion src/components/settings/SettingsFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const SettingsFooter: FC = () => {
}, []);

return (
<div className="text-sm px-2 bg-gray-200 dark:bg-gray-darker">
<div className="text-sm px-2 bg-gray-200">
<Box padding="space.050">
<Stack>
<Inline grow="fill" spread="space-between">
Expand Down
20 changes: 1 addition & 19 deletions src/electron/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
</head>

<body>
<div
id="atlassify"
class="bg-white text-black dark:bg-gray-dark dark:text-white"
></div>
<div id="atlassify"></div>
</body>

<script src="./../../build/js/app.js"></script>
Expand Down Expand Up @@ -42,21 +39,6 @@
border-radius: 10px;
}

html.dark::-webkit-scrollbar-track,
html.dark div.flex-grow::-webkit-scrollbar-track {
background-color: #090e15;
}

html.dark::-webkit-scrollbar-thumb,
html.dark div.flex-grow::-webkit-scrollbar-thumb {
background-color: #24292e;
}

html.dark::-webkit-scrollbar-thumb:hover,
html.dark div.flex-grow::-webkit-scrollbar-thumb:hover {
background-color: #3a3f44;
}

body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
Expand Down
2 changes: 1 addition & 1 deletion src/routes/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const AccountsRoute: FC = () => {
</div>
</div>

<div className="text-sm px-8 bg-gray-200 dark:bg-gray-darker">
<div className="text-sm px-8 bg-gray-200">
<Box padding="space.050">
<Flex justifyContent="end">
<Tooltip content="Add new account" position="left">
Expand Down
2 changes: 1 addition & 1 deletion src/routes/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const FiltersRoute: FC = () => {
</Stack>
</div>

<div className="text-sm bg-gray-200 dark:bg-gray-darker">
<div className="text-sm bg-gray-200">
<Box padding="space.100">
<Flex justifyContent="end">
<Tooltip content="Clear all filters" position="left">
Expand Down
2 changes: 1 addition & 1 deletion src/routes/__snapshots__/Accounts.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/routes/__snapshots__/Filters.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bfb0ae7

Please sign in to comment.