Merge pull request #179 from toeverything/opti-issue176-mitsuha-dev

opti: 1.right panel trigger button cannot click#176;
This commit is contained in:
xiaodong zuo 2022-08-10 16:51:42 +08:00 committed by GitHub
commit f381de0d8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 64 additions and 35 deletions

View File

@ -10,7 +10,6 @@ const StyledTabs = styled('div')(({ theme }) => {
display: 'flex', display: 'flex',
fontSize: '12px', fontSize: '12px',
fontWeight: '600', fontWeight: '600',
color: theme.affine.palette.primary,
}; };
}); });
@ -26,13 +25,18 @@ const StyledTabTitle = styled('div', {
padding-top: 4px; padding-top: 4px;
border-top: 2px solid #ecf1fb; border-top: 2px solid #ecf1fb;
position: relative; position: relative;
cursor: pointer;
color: ${({ theme, isActive }) =>
isActive ? theme.affine.palette.primary : 'rgba(62, 111, 219, 0.6)'};
&::after { &::after {
content: ''; content: '';
width: 0; width: 0;
height: 2px; height: 2px;
background-color: ${({ isActive, theme }) => background-color: ${({ isActive, theme }) =>
isActive ? theme.affine.palette.primary : ''}; isActive
? theme.affine.palette.primary
: 'rgba(62, 111, 219, 0.6)'};
position: absolute; position: absolute;
left: 100%; left: 100%;
top: -2px; top: -2px;

View File

@ -17,16 +17,20 @@ export const StatusIcon = ({ mode }: StatusIconProps) => {
const IconWrapper = styled('div')<Pick<StatusIconProps, 'mode'>>( const IconWrapper = styled('div')<Pick<StatusIconProps, 'mode'>>(
({ theme, mode }) => { ({ theme, mode }) => {
return { return {
width: '20px', width: '24px',
height: '20px', height: '24px',
borderRadius: '5px', borderRadius: '5px',
boxShadow: theme.affine.shadows.shadow1, boxShadow: theme.affine.shadows.shadow1,
color: theme.affine.palette.primary, color: theme.affine.palette.primary,
cursor: 'pointer', cursor: 'pointer',
backgroundColor: theme.affine.palette.white, backgroundColor: theme.affine.palette.white,
transform: `translateX(${mode === DocMode.doc ? 0 : 20}px)`, transform: `translateX(${mode === DocMode.doc ? 0 : 30}px)`,
transition: 'transform 300ms ease', transition: 'transform 300ms ease',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
'& > svg': { '& > svg': {
fontSize: '20px', fontSize: '20px',
}, },

View File

@ -2,26 +2,37 @@ import { styled } from '@toeverything/components/ui';
type StatusTextProps = { type StatusTextProps = {
children: string; children: string;
width?: string;
active?: boolean; active?: boolean;
onClick?: () => void; onClick?: () => void;
}; };
export const StatusText = ({ children, active, onClick }: StatusTextProps) => { export const StatusText = ({
children,
width,
active,
onClick,
}: StatusTextProps) => {
return ( return (
<StyledText active={active} onClick={onClick}> <StyledText width={width} active={active} onClick={onClick}>
{children} {children}
</StyledText> </StyledText>
); );
}; };
const StyledText = styled('div')<StatusTextProps>(({ theme, active }) => { const StyledText = styled('div')<StatusTextProps>(
return { ({ theme, width, active }) => {
display: 'inline-flex', return {
alignItems: 'center', display: 'inline-flex',
color: theme.affine.palette.primary, alignItems: 'center',
fontWeight: active ? '500' : '300', color: active
fontSize: '15px', ? theme.affine.palette.primary
cursor: 'pointer', : 'rgba(62, 111, 219, 0.6)',
padding: '0 6px', fontWeight: active ? '600' : '400',
}; fontSize: '16px',
}); lineHeight: '22px',
cursor: 'pointer',
...(!!width && { width }),
};
}
);

View File

@ -18,11 +18,15 @@ export const StatusTrack: FC<StatusTrackProps> = ({ mode, onClick }) => {
const Container = styled('div')(({ theme }) => { const Container = styled('div')(({ theme }) => {
return { return {
width: '64px',
height: '32px',
backgroundColor: theme.affine.palette.textHover, backgroundColor: theme.affine.palette.textHover,
borderRadius: '5px', border: '1px solid #ECF1FB',
height: '30px', borderRadius: '8px',
width: '50px',
cursor: 'pointer', cursor: 'pointer',
padding: '5px', margin: '0 8px',
display: 'flex',
alignItems: 'center',
padding: '0 4px',
}; };
}); });

View File

@ -32,6 +32,7 @@ export const Switcher = () => {
return ( return (
<StyledContainerForSwitcher> <StyledContainerForSwitcher>
<StatusText <StatusText
width={'44px'}
active={pageViewMode === DocMode.doc} active={pageViewMode === DocMode.doc}
onClick={() => switchToPageView(DocMode.doc)} onClick={() => switchToPageView(DocMode.doc)}
> >
@ -48,6 +49,7 @@ export const Switcher = () => {
}} }}
/> />
<StatusText <StatusText
width={'56px'}
active={pageViewMode === DocMode.board} active={pageViewMode === DocMode.board}
onClick={() => switchToPageView(DocMode.board)} onClick={() => switchToPageView(DocMode.board)}
> >

View File

@ -1,4 +1,4 @@
import { IconButton, styled } from '@toeverything/components/ui'; import { IconButton, styled, MuiButton } from '@toeverything/components/ui';
import { import {
LogoIcon, LogoIcon,
SideBarViewIcon, SideBarViewIcon,
@ -24,9 +24,13 @@ export const LayoutHeader = () => {
</FlexContainer> </FlexContainer>
<FlexContainer> <FlexContainer>
<StyledHelper> <StyledHelper>
<StyledShare>Share</StyledShare> <StyledShare disabled={true}>Share</StyledShare>
<div style={{ margin: '0px 12px' }}> <div style={{ margin: '0px 12px' }}>
<IconButton size="large"> <IconButton
size="large"
hoverColor={'transparent'}
disabled={true}
>
<SearchIcon /> <SearchIcon />
</IconButton> </IconButton>
</div> </div>
@ -119,17 +123,19 @@ const StyledHelper = styled('div')({
alignItems: 'center', alignItems: 'center',
}); });
const StyledShare = styled('div')({ const StyledShare = styled(MuiButton)<{ disabled?: boolean }>({
padding: '10px 12px', padding: '10px 12px',
fontWeight: 600, fontWeight: 600,
fontSize: '14px', fontSize: '14px',
color: '#3E6FDB',
cursor: 'pointer', cursor: 'pointer',
color: '#98ACBD',
'&:hover': { textTransform: 'none',
background: '#F5F7F8', /* disabled for current time */
borderRadius: '5px', // color: '#3E6FDB',
}, // '&:hover': {
// background: '#F5F7F8',
// borderRadius: '5px',
// },
}); });
const StyledLogoIcon = styled(LogoIcon)(({ theme }) => { const StyledLogoIcon = styled(LogoIcon)(({ theme }) => {
@ -141,9 +147,7 @@ const StyledLogoIcon = styled(LogoIcon)(({ theme }) => {
const StyledContainerForEditorBoardSwitcher = styled('div')(({ theme }) => { const StyledContainerForEditorBoardSwitcher = styled('div')(({ theme }) => {
return { return {
width: '100%',
position: 'absolute', position: 'absolute',
display: 'flex', left: '50%',
justifyContent: 'center',
}; };
}); });