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() { renderResults() {
const { props, state } = this; 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() {this.getSearchedCategories()
.map(category => Object({ category, categoryResults: state.results.get(category) })) .map(category => Object({ category, categoryResults: state.results.get(category) }))
.filter(category => category.categoryResults.length > 0) .filter(category => category.categoryResults.length > 0)

View File

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

View File

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