1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-11 02:13:48 +09:00

sidebar small update

This commit is contained in:
Andrew Simachev 2024-07-25 11:56:47 +02:00
parent 3dd855b791
commit 6419a1c562
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
5 changed files with 16 additions and 24 deletions

View file

@ -22,12 +22,13 @@
> .inner { width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; position: relative; z-index: 1; background-color: var(--color-shape-tertiary); }
> .inner {
> .head {
display: flex; flex-direction: row; align-items: center; justify-content: flex-start; padding: 0px 12px; height: 52px;
display: flex; flex-direction: row; align-items: center; justify-content: center; padding: 0px 12px; height: 52px;
gap: 0px 8px; overflow: hidden;
}
> .head {
.status {
@include text-small; font-weight: 500; @include text-overflow-nw; text-align: center; color: var(--color-text-secondary); flex-grow: 1;
@include text-small; font-weight: 500; @include text-overflow-nw; text-align: center; color: var(--color-text-secondary);
display: inline-block; -webkit-app-region: no-drag;
}
.icon { width: 28px; height: 28px; background-size: 20px; border-radius: 6px; cursor: default; -webkit-app-region: no-drag; }

View file

@ -342,8 +342,6 @@ const BlockCover = observer(class BlockCover extends React.Component<I.BlockComp
this.loaded = true;
};
console.log(this.loaded);
if (this.loaded) {
cb();
} else {

View file

@ -2,7 +2,7 @@ import * as React from 'react';
import $ from 'jquery';
import raf from 'raf';
import { observer } from 'mobx-react';
import { Icon, Vault } from 'Component';
import { Icon } from 'Component';
import { I, U, J, S, keyboard, Preview, sidebar, translate } from 'Lib';
import ListWidget from 'Component/list/widget';
@ -59,7 +59,7 @@ const Sidebar = observer(class Sidebar extends React.Component {
className={cn.join(' ')}
>
<div className="inner">
<div id="sidebarHead" className="head">
<div id="sidebarHead" className="head" onClick={this.onHeadClick}>
{status ? <div className="status">{status}</div> : ''}
</div>
<div
@ -192,6 +192,13 @@ const Sidebar = observer(class Sidebar extends React.Component {
};
};
onHeadClick () {
const space = U.Space.getSpaceview();
if (space && space.isShared) {
S.Popup.open('settings', { data: { page: 'spaceShare', isSpace: true }, className: 'isSpace' });
};
};
});
export default Sidebar;

View file

@ -277,12 +277,11 @@ const IconObject = observer(class IconObject extends React.Component<Props> {
cn.push('withImage');
icn = icn.concat([ 'iconImage', 'c' + iconSize ]);
icon = <img src={S.Common.imageUrl(iconImage, iconSize * 2)} className={icn.join(' ')} />;
} else
if (iconOption) {
} else {
cn.push('withOption withImage');
icn = icn.concat([ 'iconImage', 'c' + iconSize ]);
icon = <img src={this.gradientSvg(0.35)} className={icn.join(' ')} />;
icon = <img src={this.gradientSvg(iconOption || 1, 0.35)} className={icn.join(' ')} />;
}
break;
};
@ -515,10 +514,9 @@ const IconObject = observer(class IconObject extends React.Component<Props> {
return 'data:image/svg+xml;base64,' + btoa(unescape(encodeURIComponent(svg)));
};
gradientSvg (radius: number): string {
const object = this.getObject();
gradientSvg (option: number, radius: number): string {
const iconSize = this.iconSize();
const item = J.Color.icons.colors[object.iconOption - 1] as any;
const item = J.Color.icons.colors[option - 1] as any;
const { from, to } = J.Color.icons.steps;
const gradient = `

View file

@ -11,8 +11,6 @@ const WidgetSpace = observer(class WidgetSpace extends React.Component<I.WidgetC
super(props);
this.onSettings = this.onSettings.bind(this);
this.onSelect = this.onSelect.bind(this);
this.onUpload = this.onUpload.bind(this);
this.onRequest = this.onRequest.bind(this);
};
@ -29,8 +27,6 @@ const WidgetSpace = observer(class WidgetSpace extends React.Component<I.WidgetC
forceLetter={true}
size={28}
iconSize={28}
onSelect={this.onSelect}
onUpload={this.onUpload}
menuParam={{ className: 'fixed' }}
/>
<div className="txt">
@ -69,14 +65,6 @@ const WidgetSpace = observer(class WidgetSpace extends React.Component<I.WidgetC
this.openSettings('spaceIndex');
};
onSelect () {
C.WorkspaceSetInfo(S.Common.space, { iconImage: '' });
};
onUpload (objectId: string) {
C.WorkspaceSetInfo(S.Common.space, { iconImage: objectId });
};
onRequest (e: any) {
e.stopPropagation();
this.openSettings('spaceShare');