on master help sign in
fix: allow tabs to wrap, simplify half/full layout logic
537ff5bMatt Condon (shrugs)
src/components/Tabs.js+1−1
@@ -14,7 +14,7 @@ export default function Tabs({
14
14
15 return (
15 return (
16 <Grid className={className}>
16 <Grid className={className}>
17− <Grid.Item full as={Flex} className="b-gray3 bb1">
17+ <Grid.Item full as={Flex} wrap className="b-gray3 bb1">
18 {options.map(option => {
18 {options.map(option => {
19 const isActive = option.value === currentTab;
19 const isActive = option.value === currentTab;
20 return (
20 return (
src/views/Activate/ActivatePassport.js+3−4
@@ -46,8 +46,7 @@ export default function ActivatePassport() {
46 const gap = useBreakpoints([4, 4, 7]);
46 const gap = useBreakpoints([4, 4, 7]);
47 const marginTop = useBreakpoints([false, false, 8]);
47 const marginTop = useBreakpoints([false, false, 8]);
48 const full = useBreakpoints([true, true, false]);
48 const full = useBreakpoints([true, true, false]);
49− const leftHalf = useBreakpoints([false, false, 1]);
50− const rightHalf = useBreakpoints([false, false, 2]);
49+ const half = useBreakpoints([false, false, true]);
51
50
52 // addresses are not derived until we set[Urbit]Wallet(), so do that inline
51 // addresses are not derived until we set[Urbit]Wallet(), so do that inline
53 const address = useMemo(
52 const address = useMemo(
@@ -68,7 +67,7 @@ export default function ActivatePassport() {
68 <LocalRouterProvider value={router}>
67 <LocalRouterProvider value={router}>
69 <View full={fullView}>
68 <View full={fullView}>
70 <Grid gap={gap} className="mt8 mb10">
69 <Grid gap={gap} className="mt8 mb10">
71− <Grid.Item half={leftHalf} full={full}>
70+ <Grid.Item half={half && 1} full={full}>
72 <Passport
71 <Passport
73 className={cn({ [`mt${marginTop}`]: marginTop })}
72 className={cn({ [`mt${marginTop}`]: marginTop })}
74 point={derivedPoint}
73 point={derivedPoint}
@@ -77,7 +76,7 @@ export default function ActivatePassport() {
77 />
76 />
78 </Grid.Item>
77 </Grid.Item>
79 <Grid.Item
78 <Grid.Item
80− half={rightHalf}
79+ half={half && 2}
81 full={full}
80 full={full}
82 as={Route}
81 as={Route}
83 resetActivateRouter={resetActivateRouter}
82 resetActivateRouter={resetActivateRouter}
src/views/Login/Ledger.js+7−2
@@ -25,6 +25,7 @@ import {
25import { WALLET_TYPES } from 'lib/wallet';
25import { WALLET_TYPES } from 'lib/wallet';
26import useLoginView from 'lib/useLoginView';
26import useLoginView from 'lib/useLoginView';
27import SelectInput from 'indigo-react/components/SelectInput';
27import SelectInput from 'indigo-react/components/SelectInput';
28+import useBreakpoints from 'lib/useBreakpoints';
28
29
29const PATH_OPTIONS = [
30const PATH_OPTIONS = [
30 { text: 'Ledger Live', value: LEDGER_LIVE_PATH },
31 { text: 'Ledger Live', value: LEDGER_LIVE_PATH },
@@ -105,6 +106,8 @@ export default function Ledger({ className }) {
105 }
106 }
106 }, [useCustomPath, setHdPath, basePathPattern, accountIndex]);
107 }, [useCustomPath, setHdPath, basePathPattern, accountIndex]);
107
108
109+ const full = useBreakpoints([true, true, false]);
110+ const half = useBreakpoints([false, false, true]);
108 const isHTTPS = document.location.protocol === 'https:';
111 const isHTTPS = document.location.protocol === 'https:';
109
112
110 // when not on https, tell user how to get there
113 // when not on https, tell user how to get there
@@ -163,13 +166,15 @@ export default function Ledger({ className }) {
163 {!useCustomPath && (
166 {!useCustomPath && (
164 <>
167 <>
165 <Grid.Item
168 <Grid.Item
169+ full={full}
166− half={1}
170+ half={half && 1}
167 as={SelectInput}
171 as={SelectInput}
168 className="pr1"
172 className="pr1"
169 {...derivationPathInput}
173 {...derivationPathInput}
170 />
174 />
171 <Grid.Item
175 <Grid.Item
176+ full={full}
172− half={2}
177+ half={half && 2}
173 as={SelectInput}
178 as={SelectInput}
174 className="pl1"
179 className="pl1"
175 {...accountInput}
180 {...accountInput}