Compare commits

...

2 Commits

Author SHA1 Message Date
Joni Juup
d3b0fef406 optimize editor navigation by removing shortcuts on mobile, more space to tabs 2022-08-26 16:22:44 +03:00
Joni Juup
4cbc316c62 small mobile style fixes 2022-08-26 16:03:46 +03:00
9 changed files with 161 additions and 42 deletions

View File

@@ -6,11 +6,14 @@ const ButtonGroup = styled('div', {
marginLeft: '1px', marginLeft: '1px',
[`& ${StyledButton}`]: { [`& ${StyledButton}`]: {
marginLeft: '-1px', marginLeft: '-1px',
px: '$4', px: '0.65rem',
zIndex: 2, zIndex: 2,
position: 'relative', position: 'relative',
'&:hover, &:focus': { '&:hover, &:focus': {
zIndex: 200 zIndex: 200
},
'@sm': {
px: '$4'
} }
}, },
[`& ${StyledButton}:not(:only-of-type):not(:first-child):not(:last-child)`]: { [`& ${StyledButton}:not(:only-of-type):not(:first-child):not(:last-child)`]: {

View File

@@ -40,11 +40,10 @@ const StyledContent = styled(DialogPrimitive.Content, {
color: '$mauve12', color: '$mauve12',
borderRadius: '$md', borderRadius: '$md',
position: 'relative', position: 'relative',
mb: '15%', mb: '0%',
boxShadow: '0px 10px 38px -5px rgba(22, 23, 24, 0.25), 0px 10px 20px -5px rgba(22, 23, 24, 0.2)', boxShadow: '0px 10px 38px -5px rgba(22, 23, 24, 0.25), 0px 10px 20px -5px rgba(22, 23, 24, 0.2)',
width: '90vw', width: '90vw',
maxWidth: '450px', maxWidth: '450px',
// maxHeight: "85vh",
padding: 25, padding: 25,
'@media (prefers-reduced-motion: no-preference)': { '@media (prefers-reduced-motion: no-preference)': {
animation: `${contentShow} 150ms cubic-bezier(0.16, 1, 0.3, 1)` animation: `${contentShow} 150ms cubic-bezier(0.16, 1, 0.3, 1)`
@@ -53,6 +52,9 @@ const StyledContent = styled(DialogPrimitive.Content, {
'.dark &': { '.dark &': {
backgroundColor: '$mauve5', backgroundColor: '$mauve5',
boxShadow: '0px 10px 38px 0px rgba(0, 0, 0, 0.85), 0px 10px 20px 0px rgba(0, 0, 0, 0.6)' boxShadow: '0px 10px 38px 0px rgba(0, 0, 0, 0.85), 0px 10px 20px 0px rgba(0, 0, 0, 0.6)'
},
'@md': {
mb: '8%'
} }
}) })

View File

@@ -78,7 +78,6 @@ const EditorNavigation = ({ renderNav }: { renderNav?: () => ReactNode }) => {
return ( return (
<Flex css={{ flexShrink: 0, gap: '$0' }}> <Flex css={{ flexShrink: 0, gap: '$0' }}>
<Flex <Flex
id="kissa"
ref={scrollRef} ref={scrollRef}
css={{ css={{
overflowX: 'scroll', overflowX: 'scroll',
@@ -181,7 +180,21 @@ const EditorNavigation = ({ renderNav }: { renderNav?: () => ReactNode }) => {
</DropdownMenuContent> </DropdownMenuContent>
</DropdownMenu> </DropdownMenu>
) : ( ) : (
<Button outline size="sm" css={{ mr: '$3' }} onClick={() => setPopUp(true)}> <Button
outline
size="sm"
css={{
mr: '-1px',
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
'@sm': {
borderTopRightRadius: '$sm',
borderBottomRightRadius: '$sm',
mr: '$3'
}
}}
onClick={() => setPopUp(true)}
>
<GithubLogo size="16px" /> Login <GithubLogo size="16px" /> Login
</Button> </Button>
)} )}
@@ -202,6 +215,9 @@ const EditorNavigation = ({ renderNav }: { renderNav?: () => ReactNode }) => {
alignSelf: 'flex-start', alignSelf: 'flex-start',
boxShadow: 'none' boxShadow: 'none'
}, },
'button:not(:last-child)': {
display: 'none'
},
'button:not(:first-child):not(:last-child)': { 'button:not(:first-child):not(:last-child)': {
borderRight: 0, borderRight: 0,
borderLeft: 0 borderLeft: 0
@@ -217,6 +233,11 @@ const EditorNavigation = ({ renderNav }: { renderNav?: () => ReactNode }) => {
'&:hover': { '&:hover': {
boxShadow: 'inset 0px 0px 0px 1px $colors$mauve12' boxShadow: 'inset 0px 0px 0px 1px $colors$mauve12'
} }
},
'@sm': {
'button:not(:last-child)': {
display: 'flex'
}
} }
}} }}
> >

View File

@@ -33,7 +33,7 @@ import { styled } from '../stitches.config'
const ImageWrapper = styled(Flex, { const ImageWrapper = styled(Flex, {
position: 'relative', position: 'relative',
mt: '$2', mt: '$2',
mb: '$10', mb: '$6',
svg: { svg: {
// fill: "red", // fill: "red",
'.angle': { '.angle': {
@@ -66,16 +66,23 @@ const Navigation = () => {
<Container <Container
css={{ css={{
display: 'flex', display: 'flex',
alignItems: 'center' alignItems: 'center',
px: '$3',
'@sm': {
px: '$4'
}
}} }}
> >
<Flex <Flex
css={{ css={{
flex: 1, flex: 1,
alignItems: 'center', alignItems: 'center',
borderRight: '1px solid $colors$mauve6',
py: '$3', py: '$3',
pr: '$4' pr: '$0',
'@sm': {
borderRight: '1px solid $colors$mauve6',
pr: '$4'
}
}} }}
> >
<Link href={gistId ? `/develop/${gistId}` : '/develop'} passHref> <Link href={gistId ? `/develop/${gistId}` : '/develop'} passHref>
@@ -84,7 +91,11 @@ const Navigation = () => {
css={{ css={{
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
color: '$textColor' color: '$textColor',
mr: '$2',
'@sm': {
mr: '$4'
}
}} }}
> >
<Logo width="32px" height="32px" /> <Logo width="32px" height="32px" />
@@ -92,9 +103,12 @@ const Navigation = () => {
</Link> </Link>
<Flex <Flex
css={{ css={{
ml: '$5',
flexDirection: 'column', flexDirection: 'column',
gap: '1px' gap: '1px',
display: 'none',
'@md': {
display: 'flex'
}
}} }}
> >
{snap.loading ? ( {snap.loading ? (
@@ -135,8 +149,8 @@ const Navigation = () => {
css={{ css={{
display: 'flex', display: 'flex',
maxWidth: '1080px', maxWidth: '1080px',
width: '80vw', width: '90vw',
maxHeight: '80%', maxHeight: '90%',
backgroundColor: '$mauve1 !important', backgroundColor: '$mauve1 !important',
overflowY: 'auto', overflowY: 'auto',
background: 'black', background: 'black',
@@ -265,15 +279,18 @@ const Navigation = () => {
gridTemplateColumns: '1fr', gridTemplateColumns: '1fr',
gridTemplateRows: 'max-content', gridTemplateRows: 'max-content',
flex: 1, flex: 1,
p: '$7', p: '$4',
pb: '$16', pb: '$8',
gap: '$3', gap: '$3',
alignItems: 'normal', alignItems: 'normal',
flexWrap: 'wrap', flexWrap: 'wrap',
backgroundColor: '$mauve1', backgroundColor: '$mauve1',
'@md': { '@md': {
gridTemplateColumns: '1fr 1fr', gridTemplateColumns: '1fr 1fr',
gridTemplateRows: 'max-content' gridTemplateRows: 'max-content',
p: '$7',
pb: '$10',
paddingRight: '$12'
}, },
'@lg': { '@lg': {
gridTemplateColumns: '1fr 1fr 1fr', gridTemplateColumns: '1fr 1fr 1fr',
@@ -316,23 +333,30 @@ const Navigation = () => {
<Flex <Flex
css={{ css={{
flexWrap: 'nowrap', flexWrap: 'nowrap',
marginLeft: '$4', marginLeft: '$2',
overflowX: 'scroll', overflowX: 'scroll',
'&::-webkit-scrollbar': { '&::-webkit-scrollbar': {
height: 0, height: 0,
background: 'transparent' background: 'transparent'
}, },
scrollbarColor: 'transparent', scrollbarColor: 'transparent',
scrollbarWidth: 'none' scrollbarWidth: 'none',
'@sm': {
marginLeft: '$4'
}
}} }}
> >
<Stack <Stack
css={{ css={{
ml: '$4', ml: '$0',
gap: '$3', gap: '$2',
flexWrap: 'nowrap', flexWrap: 'nowrap',
alignItems: 'center', alignItems: 'center',
marginLeft: 'auto' marginLeft: 'auto',
'@sm': {
marginLeft: '$4',
gap: '$3'
}
}} }}
> >
<ButtonGroup> <ButtonGroup>

View File

@@ -7,7 +7,7 @@ const PanelBox = styled('div', {
flexDirection: 'column', flexDirection: 'column',
border: '1px solid $colors$mauve6', border: '1px solid $colors$mauve6',
backgroundColor: '$mauve2', backgroundColor: '$mauve2',
padding: '$3', padding: '$5',
borderRadius: '$sm', borderRadius: '$sm',
fontWeight: 'lighter', fontWeight: 'lighter',
height: 'auto', height: 'auto',

View File

@@ -185,11 +185,16 @@ const Transaction: FC<TransactionProps> = ({ header, state: txState, ...props })
row row
css={{ css={{
justifyContent: 'space-between', justifyContent: 'space-between',
position: 'absolute',
left: 0,
bottom: 0,
width: '100%', width: '100%',
mb: '$1' mb: '$2',
mt: '$1',
'@md': {
position: 'absolute',
left: 0,
bottom: 0,
mt: '$0',
mb: '$2'
}
}} }}
> >
<Button <Button

View File

@@ -137,11 +137,14 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
row row
fluid fluid
css={{ css={{
justifyContent: 'flex-end', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
mb: '$3', mb: '$3',
mt: '1px', mt: '1px',
pr: '1px' pr: '1px',
'@xl': {
justifyContent: 'flex-end'
}
}} }}
> >
<Text muted css={{ mr: '$3' }}> <Text muted css={{ mr: '$3' }}>
@@ -152,7 +155,13 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
placeholder="Select transaction type" placeholder="Select transaction type"
options={transactionsOptions} options={transactionsOptions}
hideSelectedOptions hideSelectedOptions
css={{ width: '70%' }} css={{
width: '60%',
minWidth: '200px',
'@lg': {
width: '70%'
}
}}
value={selectedTransaction} value={selectedTransaction}
onChange={(tt: any) => handleChangeTxType(tt)} onChange={(tt: any) => handleChangeTxType(tt)}
/> />
@@ -161,10 +170,13 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
row row
fluid fluid
css={{ css={{
justifyContent: 'flex-end', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
mb: '$3', mb: '$3',
pr: '1px' pr: '1px',
'@xl': {
justifyContent: 'flex-end'
}
}} }}
> >
<Text muted css={{ mr: '$3' }}> <Text muted css={{ mr: '$3' }}>
@@ -173,7 +185,13 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
<Select <Select
instanceId="from-account" instanceId="from-account"
placeholder="Select your account" placeholder="Select your account"
css={{ width: '70%' }} css={{
width: '60%',
minWidth: '200px',
'@lg': {
width: '70%'
}
}}
options={accountOptions} options={accountOptions}
value={selectedAccount} value={selectedAccount}
onChange={(acc: any) => handleSetAccount(acc)} // TODO make react-select have correct types for acc onChange={(acc: any) => handleSetAccount(acc)} // TODO make react-select have correct types for acc
@@ -184,10 +202,13 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
row row
fluid fluid
css={{ css={{
justifyContent: 'flex-end', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
mb: '$3', mb: '$3',
pr: '1px' pr: '1px',
'@xl': {
justifyContent: 'flex-end'
}
}} }}
> >
<Text muted css={{ mr: '$3' }}> <Text muted css={{ mr: '$3' }}>
@@ -196,7 +217,13 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
<Select <Select
instanceId="to-account" instanceId="to-account"
placeholder="Select the destination account" placeholder="Select the destination account"
css={{ width: '70%' }} css={{
width: '60%',
minWidth: '200px',
'@lg': {
width: '70%'
}
}}
options={destAccountOptions} options={destAccountOptions}
value={selectedDestAccount} value={selectedDestAccount}
isClearable isClearable
@@ -229,9 +256,12 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
row row
fluid fluid
css={{ css={{
justifyContent: 'flex-end', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
position: 'relative' position: 'relative',
'@xl': {
justifyContent: 'flex-end'
}
}} }}
> >
<Text muted css={{ mr: '$3' }}> <Text muted css={{ mr: '$3' }}>
@@ -244,9 +274,13 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
spellCheck={false} spellCheck={false}
onChange={switchToJson} onChange={switchToJson}
css={{ css={{
width: '70%', width: '60%',
minWidth: '200px',
flex: 'inherit', flex: 'inherit',
resize: 'vertical' resize: 'vertical',
'@lg': {
width: '70%'
}
}} }}
/> />
) : ( ) : (
@@ -271,7 +305,8 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
: undefined : undefined
} }
css={{ css={{
width: '70%', width: '60%',
minWidth: '200px',
flex: 'inherit', flex: 'inherit',
'-moz-appearance': 'textfield', '-moz-appearance': 'textfield',
'&::-webkit-outer-spin-button': { '&::-webkit-outer-spin-button': {
@@ -281,6 +316,9 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
'&::-webkit-inner-spin-button ': { '&::-webkit-inner-spin-button ': {
'-webkit-appearance': 'none', '-webkit-appearance': 'none',
margin: 0 margin: 0
},
'@lg': {
width: '70%'
} }
}} }}
/> />

View File

@@ -68,6 +68,7 @@ const Test = () => {
justifyContent: 'center', justifyContent: 'center',
p: '$3 $2' p: '$3 $2'
}} }}
className="split-mobile-forceAutoHeight"
> >
<Split <Split
direction="horizontal" direction="horizontal"
@@ -82,6 +83,7 @@ const Test = () => {
height: '100%' height: '100%'
}} }}
onDragEnd={e => saveSplit('testHorizontal', e)} onDragEnd={e => saveSplit('testHorizontal', e)}
className="split-mobile-forceVertical"
> >
<Box css={{ width: '55%', px: '$2' }}> <Box css={{ width: '55%', px: '$2' }}>
<Tabs <Tabs
@@ -105,7 +107,18 @@ const Test = () => {
))} ))}
</Tabs> </Tabs>
</Box> </Box>
<Box css={{ width: '45%', mx: '$2', height: '100%' }}> <Box
css={{
width: '45%',
mx: '$0',
mt: '$1',
height: '100%',
'@md': {
mx: '$2',
mt: '$0'
}
}}
>
<Accounts card hideDeployBtn showHookStats /> <Accounts card hideDeployBtn showHookStats />
</Box> </Box>
</Split> </Split>
@@ -131,6 +144,7 @@ const Test = () => {
<Flex> <Flex>
<Split <Split
direction="horizontal" direction="horizontal"
className="split-mobile-forceVertical"
sizes={[50, 50]} sizes={[50, 50]}
minSize={[320, 160]} minSize={[320, 160]}
gutterSize={4} gutterSize={4}

View File

@@ -54,3 +54,15 @@ html.light .gutter-horizontal:hover {
.monaco-editor .monaco-hover { .monaco-editor .monaco-hover {
z-index: 9999; z-index: 9999;
} }
@media screen and (max-width: 48rem) {
.split-mobile-forceAutoHeight {
height: auto !important;
}
.split-mobile-forceVertical {
flex-direction: column !important;
}
.split-mobile-forceVertical > div {
width: 100% !important;
}
}