Merge pull request #3334 from urbit/mp/statusbar-lineheights

statusBar: rewrite in indigo, line-height tweak
This commit is contained in:
matildepark 2020-08-17 18:35:42 -04:00 committed by GitHub
commit 4a0112c97d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 26 deletions

View File

@ -192,7 +192,13 @@ export class Omnibox extends Component {
renderResults() {
const { props, state } = this;
return <Box maxHeight="400px" overflowY="scroll" overflowX="hidden">
return <Box
maxHeight="400px"
overflowY="auto"
overflowX="hidden"
borderBottomLeftRadius='2'
borderBottomRightRadius='2'
>
{this.getSearchedCategories()
.map(category => Object({ category, categoryResults: state.results.get(category) }))
.filter(category => category.categoryResults.length > 0)

View File

@ -8,13 +8,14 @@ const ReconnectButton = ({ connection, subscription }) => {
return (
<>
<Box
ml={4}
ml={2}
px={2}
py={1}
display='inline-block'
color='red'
border={1}
lineHeight='min'
verticalAlign="middle"
lineHeight='0'
borderRadius={2}
style={{ cursor: 'pointer' }}
onClick={reconnect}>
@ -26,10 +27,11 @@ const ReconnectButton = ({ connection, subscription }) => {
return (
<>
<Box
ml={4}
ml={2}
px={2}
py={1}
lineHeight="min"
lineHeight="0"
verticalAlign="middle"
display='inline-block'
color='yellow'
border={1}

View File

@ -1,15 +1,12 @@
import React from 'react';
import { useLocation } from 'react-router-dom';
import { Box, Text, Icon } from '@tlon/indigo-react';
import { Row, Box, Text, Icon } from '@tlon/indigo-react';
import ReconnectButton from './ReconnectButton';
const StatusBar = (props) => {
const location = useLocation();
const atHome = Boolean(location.pathname === '/');
const display = (!window.location.href.includes('popout/'))
? 'db' : 'dn';
const invites = (props.invites && props.invites['/contacts'])
? props.invites['/contacts']
: {};
@ -28,28 +25,32 @@ const StatusBar = (props) => {
);
return (
<div
className={
'bg-white bg-gray0-d w-100 justify-between relative tc pt3 ' + display
}
style={{ height: 45 }}>
<div className='absolute left-0 pl4' style={{ top: 10 }}>
<Row
height="45px"
backgroundColor="white"
width="100%"
justifyContent="space-between"
pt="10px"
display={(window.location.href.includes('popout/') ? 'none' : 'flex')}>
<Box pl={3} display="inline-block">
{atHome ? null : (
<Box
style={{ cursor: 'pointer' }}
display='inline-block'
borderRadius={2}
verticalAlign="middle"
lineHeight="0"
color='washedGray'
border={1}
py={1}
py="6px"
px={2}
mr={2}
onClick={() => props.history.push('/')}>
<img
className='invert-d'
src='/~landscape/img/icon-home.png'
height='12'
width='12'
height='11'
width='11'
/>
</Box>
)}
@ -58,8 +59,9 @@ const StatusBar = (props) => {
borderRadius={2}
color='washedGray'
display='inline-block'
verticalAlign='middle'
lineHeight="0"
style={{ cursor: 'pointer' }}
lineHeight='min'
py={1}
px={2}
onClick={() => props.api.local.setOmnibox()}>
@ -77,14 +79,15 @@ const StatusBar = (props) => {
connection={props.connection}
subscription={props.subscription}
/>
</div>
<div className='fl absolute relative right-0 pr4' style={{ top: 10 }}>
</Box>
<Box position="relative" pr={3} display="inline-block">
<Box
style={{ cursor: 'pointer' }}
display='inline-block'
borderRadius={2}
color='washedGray'
lineHeight='min'
verticalAlign="middle"
lineHeight='0'
border={1}
px={2}
py={1}
@ -92,14 +95,14 @@ const StatusBar = (props) => {
<img
className='invert-d v-mid mr1'
src='/~landscape/img/groups.png'
height='16'
width='16'
height='15'
width='15'
/>
{Notification}
<Text ml={1}>Groups</Text>
</Box>
</div>
</div>
</Box>
</Row>
);
};