Skip to content

Commit 3364a82

Browse files
authored
chore: replace theme color (AppFlowy-IO#10)
1 parent bf185d4 commit 3364a82

File tree

43 files changed

+208
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+208
-237
lines changed

src/components/_shared/gallery-preview/GalleryPreview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface GalleryPreviewProps {
2424
previewIndex: number;
2525
}
2626

27-
const buttonClassName = 'p-1 hover:bg-transparent text-white hover:text-content-blue-400 p-0';
27+
const buttonClassName = 'p-1 hover:bg-transparent text-white hover:text-text-action p-0';
2828

2929
function GalleryPreview({ images, open, onClose, previewIndex }: GalleryPreviewProps) {
3030
const { t } = useTranslation();
@@ -171,7 +171,7 @@ function GalleryPreview({ images, open, onClose, previewIndex }: GalleryPreviewP
171171
<IconButton
172172
size={'small'}
173173
onClick={onClose}
174-
className={'rounded-[8px] bg-bg-mask px-3.5 text-white hover:text-content-blue-400'}
174+
className={'rounded-[8px] bg-bg-mask px-3.5 text-white hover:text-text-action'}
175175
>
176176
<CloseIcon />
177177
</IconButton>

src/components/_shared/icon-picker/IconPicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function IconPicker({
166166
href={'https://www.streamlinehq.com/'}
167167
target={'_blank'}
168168
rel={'noreferrer'}
169-
className={'ml-1 text-content-blue-400 underline'}
169+
className={'ml-1 text-text-action underline'}
170170
>
171171
Streamline
172172
</a>

src/components/_shared/mobile-outline/OutlineItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function OutlineItem({
3535
backgroundColor: selected ? 'var(--fill-content-hover)' : undefined,
3636
}}
3737
className={
38-
'flex w-full items-center gap-1 rounded-[8px] px-1 py-2 text-lg focus:bg-content-blue-50 focus:outline-none'
38+
'flex w-full items-center gap-1 rounded-[8px] px-1 py-2 text-lg focus:bg-fill-theme-select focus:outline-none'
3939
}
4040
>
4141
{item.children?.length ? getIcon() : null}

src/components/_shared/outline/OutlineItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function OutlineItem({
5252
}}
5353
id={`${variant}-view-${item.view_id}`}
5454
className={
55-
'flex min-h-[30px] w-full items-center gap-0.5 rounded-[8px] text-sm hover:bg-content-blue-50 focus:bg-content-blue-50 focus:outline-none'
55+
'flex min-h-[30px] w-full items-center gap-0.5 rounded-[8px] text-sm hover:bg-fill-theme-select focus:bg-fill-theme-select focus:outline-none'
5656
}
5757
>
5858
{item.children?.length ? getIcon() : null}

src/components/_shared/switch/Switch.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { styled, Switch as MUISwitch, SwitchProps } from '@mui/material';
22

33
export const Switch = styled((props: SwitchProps) => (
4-
<MUISwitch
5-
focusVisibleClassName=".Mui-focusVisible"
6-
disableRipple
7-
{...props}
8-
/>
4+
<MUISwitch focusVisibleClassName='.Mui-focusVisible' disableRipple {...props} />
95
))(({ theme, size }) => ({
106
width: size === 'small' ? 30 : 56,
117
height: size === 'small' ? 18 : 32,
@@ -18,19 +14,19 @@ export const Switch = styled((props: SwitchProps) => (
1814
transform: size === 'small' ? 'translateX(12px)' : 'translateX(16px)',
1915
color: '#fff',
2016
'& + .MuiSwitch-track': {
21-
backgroundColor: 'var(--fill-default)',
17+
backgroundColor: 'var(--text-action)',
2218
opacity: 1,
2319
border: 0,
2420
...theme.applyStyles('dark', {
25-
backgroundColor: 'var(--fill-default)',
21+
backgroundColor: 'var(--text-action)',
2622
}),
2723
},
2824
'&.Mui-disabled + .MuiSwitch-track': {
2925
opacity: 0.5,
3026
},
3127
},
3228
'&.Mui-focusVisible .MuiSwitch-thumb': {
33-
color: 'var(--fill-default)',
29+
color: 'var(--text-action)',
3430
border: '6px solid #fff',
3531
},
3632
'&.Mui-disabled .MuiSwitch-thumb': {
@@ -62,4 +58,4 @@ export const Switch = styled((props: SwitchProps) => (
6258
backgroundColor: '#39393D',
6359
}),
6460
},
65-
}));
61+
}));

src/components/app/SideBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function SideBar({ drawerWidth, drawerOpened, toggleOpenDrawer, onResizeDrawerWi
3737
<div className={'flex w-full flex-1 flex-col gap-1'}>
3838
<div
3939
className={
40-
'sticky top-12 z-[1] flex-col items-center justify-around gap-2 bg-surface-container-layer-01 px-[10px]'
40+
'sticky top-12 z-[1] flex-col items-center justify-around gap-2 bg-surface-container-layer-00 px-[10px]'
4141
}
4242
>
4343
<Search />

src/components/app/favorite/Favorite.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export function Favorite() {
134134
}}
135135
ref={moreButtonRef}
136136
className={
137-
'flex w-full cursor-pointer items-center gap-2 rounded-[8px] px-2 py-1.5 text-sm hover:bg-content-blue-50 focus:bg-content-blue-50 focus:outline-none'
137+
'flex w-full cursor-pointer items-center gap-2 rounded-[8px] px-2 py-1.5 text-sm hover:bg-fill-theme-select focus:bg-fill-theme-select focus:outline-none'
138138
}
139139
>
140140
<MoreIcon className={'h-5 w-5 text-text-secondary'} />

src/components/app/landing-pages/ApproveRequestPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function ApproveRequestPage() {
238238
email: (
239239
<span
240240
onClick={() => window.open(`mailto:[email protected]`, '_blank')}
241-
className={'cursor-pointer text-fill-default underline'}
241+
className={'cursor-pointer text-text-action underline'}
242242
>
243243
244244
</span>

src/components/app/share/ShareTabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function ShareTabs({ opened, viewId, onClose }: { opened: boolean; viewId: strin
3232
{
3333
value: TabKey.PUBLISH,
3434
label: t('shareAction.publish'),
35-
icon: view?.is_published ? <SuccessIcon className={'mb-0 h-5 w-5 text-fill-default'} /> : undefined,
35+
icon: view?.is_published ? <SuccessIcon className={'mb-0 h-5 w-5 text-text-action'} /> : undefined,
3636
Panel: PublishPanel,
3737
},
3838
currentUser?.email?.endsWith('appflowy.io') &&
Lines changed: 51 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
import { View, ViewLayout } from '@/application/types';
2-
import { Separator } from '@/components/ui/separator';
3-
import { toast } from 'sonner';
4-
import { filterOutByCondition } from '@/components/_shared/outline/utils';
2+
import { ReactComponent as SelectedIcon } from '@/assets/icons/tick.svg';
53
import { useAppHandlers, useAppOutline } from '@/components/app/app.hooks';
64
import SpaceItem from '@/components/app/outline/SpaceItem';
5+
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
6+
import { Separator } from '@/components/ui/separator';
7+
import OutlineIcon from '@/components/_shared/outline/OutlineIcon';
8+
import { filterOutByCondition } from '@/components/_shared/outline/utils';
79
import React, { useMemo } from 'react';
810
import { useTranslation } from 'react-i18next';
9-
import OutlineIcon from '@/components/_shared/outline/OutlineIcon';
10-
import { ReactComponent as SelectedIcon } from '@/assets/icons/tick.svg';
11-
import {
12-
Popover,
13-
PopoverTrigger,
14-
PopoverContent,
15-
} from '@/components/ui/popover';
11+
import { toast } from 'sonner';
1612

1713
import { Button } from '@/components/ui/button';
1814
import { SearchInput } from '@/components/ui/search-input';
1915

20-
function MovePagePopover ({
16+
function MovePagePopover({
2117
viewId,
2218
onMoved,
2319
children,
@@ -32,14 +28,15 @@ function MovePagePopover ({
3228
const outline = useAppOutline();
3329

3430
const [search, setSearch] = React.useState<string>('');
35-
const {
36-
movePage,
37-
} = useAppHandlers();
31+
const { movePage } = useAppHandlers();
3832

3933
const views = useMemo(() => {
4034
if (!outline) return [];
4135
return filterOutByCondition(outline, (view) => ({
42-
remove: view.view_id === viewId || view.layout !== ViewLayout.Document || Boolean(search && !view.name.toLowerCase().includes(search.toLowerCase())),
36+
remove:
37+
view.view_id === viewId ||
38+
view.layout !== ViewLayout.Document ||
39+
Boolean(search && !view.name.toLowerCase().includes(search.toLowerCase())),
4340
}));
4441
}, [outline, search, viewId]);
4542
const { t } = useTranslation();
@@ -66,19 +63,24 @@ function MovePagePopover ({
6663
}
6764
}, [movePage, onMoved, selectedViewId, viewId]);
6865

69-
const renderExtra = React.useCallback(({ view }: { view: View }) => {
70-
if (view.view_id !== selectedViewId) return null;
71-
return <SelectedIcon className={'text-fill-default mx-2'} />;
72-
}, [selectedViewId]);
66+
const renderExtra = React.useCallback(
67+
({ view }: { view: View }) => {
68+
if (view.view_id !== selectedViewId) return null;
69+
return <SelectedIcon className={'mx-2 text-text-action'} />;
70+
},
71+
[selectedViewId]
72+
);
7373

7474
return (
7575
<Popover modal {...props}>
7676
<PopoverTrigger asChild>{children}</PopoverTrigger>
7777
<PopoverContent
78-
onCloseAutoFocus={e => {
78+
onCloseAutoFocus={(e) => {
7979
e.preventDefault();
80-
}} {...popoverContentProps}>
81-
<div className={'flex folder-views w-full flex-1 flex-col gap-2 p-2'}>
80+
}}
81+
{...popoverContentProps}
82+
>
83+
<div className={'folder-views flex w-full flex-1 flex-col gap-2 p-2'}>
8284
<SearchInput
8385
value={search}
8486
onChange={(e) => {
@@ -87,53 +89,48 @@ function MovePagePopover ({
8789
autoFocus={true}
8890
placeholder={t('disclosureAction.movePageTo')}
8991
/>
90-
<div className={'flex-1 max-h-[400px] overflow-x-hidden overflow-y-auto appflowy-custom-scroller'}>
92+
<div className={'appflowy-custom-scroller max-h-[400px] flex-1 overflow-y-auto overflow-x-hidden'}>
9193
{views.map((view) => {
9294
const isExpanded = expandViewIds.includes(view.view_id);
9395

94-
return <div
95-
key={view.view_id}
96-
className={'flex items-start gap-1'}
97-
>
98-
<div className={'h-[30px] flex items-center'}>
99-
<OutlineIcon
100-
isExpanded={isExpanded}
101-
setIsExpanded={(status) => {
102-
toggleExpandView(view.view_id, status);
96+
return (
97+
<div key={view.view_id} className={'flex items-start gap-1'}>
98+
<div className={'flex h-[30px] items-center'}>
99+
<OutlineIcon
100+
isExpanded={isExpanded}
101+
setIsExpanded={(status) => {
102+
toggleExpandView(view.view_id, status);
103+
}}
104+
level={0}
105+
/>
106+
</div>
107+
108+
<SpaceItem
109+
view={view}
110+
key={view.view_id}
111+
width={268}
112+
expandIds={expandViewIds}
113+
toggleExpand={toggleExpandView}
114+
onClickView={(viewId) => {
115+
toggleExpandView(viewId, !expandViewIds.includes(viewId));
116+
setSelectedViewId(viewId);
103117
}}
104-
level={0}
118+
onClickSpace={setSelectedViewId}
119+
renderExtra={renderExtra}
105120
/>
106121
</div>
107-
108-
<SpaceItem
109-
view={view}
110-
key={view.view_id}
111-
width={268}
112-
expandIds={expandViewIds}
113-
toggleExpand={toggleExpandView}
114-
onClickView={viewId => {
115-
toggleExpandView(viewId, !expandViewIds.includes(viewId));
116-
setSelectedViewId(viewId);
117-
}}
118-
onClickSpace={setSelectedViewId}
119-
renderExtra={renderExtra}
120-
/></div>;
122+
);
121123
})}
122124
</div>
123125

124126
<Separator className={'mb-1'} />
125127
<div className={'flex items-center justify-end'}>
126-
<Button
127-
onClick={handleMoveTo}
128-
>
129-
{t('disclosureAction.move')}
130-
</Button>
128+
<Button onClick={handleMoveTo}>{t('disclosureAction.move')}</Button>
131129
</div>
132130
</div>
133131
</PopoverContent>
134-
135132
</Popover>
136133
);
137134
}
138135

139-
export default MovePagePopover;
136+
export default MovePagePopover;

0 commit comments

Comments
 (0)