fix: publish style

This commit is contained in:
DiamondThree 2023-01-08 19:12:02 +08:00
parent 4e3af83bbf
commit 17c79eebe4
4 changed files with 19 additions and 25 deletions

View File

@ -47,16 +47,14 @@ export const MembersPage = ({ workspace }: { workspace: Workspace }) => {
// console.log(err);
// });
// }, [workspace.id]);
useEffect(() => {
setMembersList();
// refreshMembers();
});
const setMembersList = () => {
const members = getMembers(workspace.id);
members && setMembers(members);
};
useEffect(() => {
setMembersList();
// refreshMembers();
}, [setMembersList]);
return (
<div>

View File

@ -39,10 +39,10 @@ export const PublishPage = ({ workspace }: { workspace: Workspace }) => {
}).then(confirm => {
if (confirm) {
if (user) {
updateWorkspaceMeta(workspace.id, { isPublish: true });
updateWorkspaceMeta(workspace.id, { type: 'cloud' });
} else {
login();
updateWorkspaceMeta(workspace.id, { isPublish: true });
updateWorkspaceMeta(workspace.id, { type: 'cloud' });
}
}
});
@ -57,9 +57,7 @@ export const PublishPage = ({ workspace }: { workspace: Workspace }) => {
<StyledPublishExplanation>
Publishing to web requires AFFiNE Cloud service .
</StyledPublishExplanation>
<StyledSettingH2 marginTop={48}>
Share with link
</StyledSettingH2>
<StyledSettingH2>Share with link</StyledSettingH2>
<StyledPublishCopyContainer>
<Input width={500} value={shareUrl} disabled={true}></Input>
<StyledCopyButtonContainer>
@ -76,17 +74,7 @@ export const PublishPage = ({ workspace }: { workspace: Workspace }) => {
</StyledPublishExplanation>
)}
</StyledPublishContent>
{!workspace.isPublish ? (
<Button
onClick={() => {
togglePublic(true);
}}
type="primary"
shape="circle"
>
Publish to web
</Button>
) : (
{workspace.isPublish ? (
<Button
onClick={() => {
togglePublic(false);
@ -96,6 +84,16 @@ export const PublishPage = ({ workspace }: { workspace: Workspace }) => {
>
Stop publishing
</Button>
) : (
<Button
onClick={() => {
togglePublic(true);
}}
type="primary"
shape="circle"
>
Publish to web
</Button>
)}
</div>
) : (

View File

@ -215,8 +215,7 @@ export const StyledPublishCopyContainer = styled('div')(() => {
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
height: '38px',
marginBottom: '20px',
paddingTop: '20px',
};
});

View File

@ -156,7 +156,6 @@ export const TemporaryHelperProvider = ({
setWorkspaceMetaList(workspacesMeta);
},
setActiveWorkspace(workspaceData) {
console.log('workspaceData: ', workspaceData);
localStorage.setItem(
'affine-active-workspace',
JSON.stringify(workspaceData)