Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update the style of help island in edgeless mode #2244

Merged
merged 2 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/web/src/components/pure/help-island/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useAtom } from 'jotai';
import { lazy, Suspense, useState } from 'react';

import { openOnboardingModalAtom } from '../../../atoms';
import { useCurrentMode } from '../../../hooks/current/use-current-mode';
import { ShortcutsModal } from '../shortcuts-modal';
import { ContactIcon, HelpIcon, KeyboardIcon } from './Icons';
import {
Expand All @@ -32,6 +33,7 @@ export const HelpIsland = ({
}: {
showList?: IslandItemNames[];
}) => {
const mode = useCurrentMode();
const [, setOpenOnboarding] = useAtom(openOnboardingModalAtom);
const [spread, setShowSpread] = useState(false);
// const { triggerShortcutsModal, triggerContactModal } = useModal();
Expand Down Expand Up @@ -62,6 +64,7 @@ export const HelpIsland = ({
onClick={() => {
setShowSpread(!spread);
}}
inEdgelessPage={mode === 'edgeless'}
>
<StyledAnimateWrapper
style={{ height: spread ? `${showList.length * 44}px` : 0 }}
Expand Down
10 changes: 8 additions & 2 deletions apps/web/src/components/pure/help-island/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@ import { displayFlex, positionAbsolute, styled } from '@affine/component';

export const StyledIsland = styled('div')<{
spread: boolean;
}>(({ spread }) => {
inEdgelessPage?: boolean;
}>(({ spread, inEdgelessPage }) => {
return {
transition: 'box-shadow 0.2s',
width: '44px',
position: 'relative',
boxShadow: spread ? 'var(--affine-menu-shadow)' : 'unset',
boxShadow: spread
? 'var(--affine-menu-shadow)'
: inEdgelessPage
? 'var(--affine-menu-shadow)'
: 'unset',
padding: '0 4px 44px',
borderRadius: '10px',
background: spread
? 'var(--affine-background-overlay-panel-color)'
: 'var(--affine-background-primary-color)',
':hover': {
background: spread ? null : 'var(--affine-white)',
boxShadow: spread ? null : 'var(--affine-menu-shadow)',
},
'::after': {
content: '""',
Expand Down
1 change: 1 addition & 0 deletions packages/component/src/theme/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ input {
border-radius: 0; /*Solve the problem of rounded corners of the input box on ios*/
outline: medium; /*Remove the default yellow border on mouse click*/
background-color: transparent;
caret-color: var(--affine-primary-color);
}

input:-webkit-autofill {
Expand Down