style: modify the style of community item (#3143)

(cherry picked from commit b2fed03f30)
This commit is contained in:
JimmFly
2023-07-11 14:44:06 +08:00
committed by Alex Yang
parent 74e6fd8d4a
commit 0c66780fda
4 changed files with 30 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
import { Button, FlexWrapper, Switch } from '@affine/component';
import { Button, FlexWrapper, Switch, Tooltip } from '@affine/component';
import { SettingRow } from '@affine/component/setting-components';
import { Unreachable } from '@affine/env/constant';
import type {
@@ -92,30 +92,19 @@ const PublishPanelAffine: FC<PublishPanelAffineProps> = props => {
const FakePublishPanelAffine: FC<{
workspace: AffineOfficialWorkspace;
}> = ({ workspace }) => {
}> = () => {
const t = useAFFiNEI18N();
const [origin, setOrigin] = useState('');
const shareUrl = origin + '/public-workspace/' + workspace.id;
useEffect(() => {
setOrigin(
typeof window !== 'undefined' && window.location.origin
? window.location.origin
: ''
);
}, []);
return (
<div className={style.fakeWrapper}>
<SettingRow name={t['Publish']()} desc={t['Unpublished hint']()}>
<Switch checked={false} />
</SettingRow>
<FlexWrapper justifyContent="space-between">
<Button className={style.urlButton} size="middle" title={shareUrl}>
{shareUrl}
</Button>
<Button size="middle">{t['Copy']()}</Button>
</FlexWrapper>
</div>
<Tooltip
content={t['com.affine.settings.workspace.publish.local-tooltip']()}
placement="top"
>
<div className={style.fakeWrapper}>
<SettingRow name={t['Publish']()} desc={t['Unpublished hint']()}>
<Switch checked={false} />
</SettingRow>
</div>
</Tooltip>
);
};
const PublishPanelLocal: FC<PublishPanelLocalProps> = ({

View File

@@ -57,7 +57,17 @@ globalStyle(`${urlButton} span`, {
export const fakeWrapper = style({
position: 'relative',
borderRadius: '8px',
background: 'var(--affine-white-60)',
padding: '10px',
opacity: 0.4,
marginTop: '24px',
selectors: {
'&::after': {
content: '""',
width: '100%',
height: '100%',
position: 'absolute',
left: 0,
top: 0,
cursor: 'not-allowed',
},
},
});

View File

@@ -23,9 +23,8 @@ globalStyle(`${link} .icon`, {
export const communityWrapper = style({
display: 'grid',
justifyContent: 'space-between',
gridTemplateColumns: 'repeat(auto-fill, 70px)',
gridGap: '6px',
gridTemplateColumns: '15% 15% 15% 15% 15% 15%',
gap: '2%',
});
export const communityItem = style({
borderRadius: '8px',