|
1 |
| -import { Box, Flex, Grid } from "@chakra-ui/react" |
| 1 | +import { Box, Flex, Grid, useToken } from "@chakra-ui/react" |
2 | 2 | import React from "react"
|
3 | 3 |
|
4 | 4 | export type Props = {
|
@@ -63,56 +63,52 @@ export const BannerGrid: React.FC<Props> = ({ children }) => {
|
63 | 63 | }
|
64 | 64 |
|
65 | 65 | export const BannerGridCell: React.FC<Props> = ({ children }) => {
|
| 66 | + const [medBp, lgBp] = useToken("breakpoints", ["md", "lg"]) |
| 67 | + |
66 | 68 | return (
|
67 | 69 | <Flex
|
68 | 70 | px={12}
|
69 | 71 | py={8}
|
70 | 72 | direction="column"
|
71 | 73 | borderTop="1px solid"
|
72 | 74 | borderTopColor="searchBackground"
|
73 |
| - borderLeft={{ base: "none", md: "1px solid" }} |
| 75 | + borderLeft={{ base: 0, md: "1px solid" }} |
74 | 76 | borderLeftColor={{ md: "searchBackground" }}
|
75 | 77 | sx={{
|
76 | 78 | "&:first-child": {
|
77 |
| - borderTop: "none", |
78 |
| - lg: { |
79 |
| - paddingLeft: 0, |
80 |
| - borderLeft: "none", |
| 79 | + borderTop: 0, |
| 80 | + }, |
| 81 | + [`@media (min-width: ${medBp})`]: { |
| 82 | + "&:nth-child(-n + 2)": { |
| 83 | + borderTop: 0, |
| 84 | + }, |
| 85 | + "&:nth-child(2n + 1)": { |
| 86 | + borderLeft: 0, |
81 | 87 | },
|
82 | 88 | },
|
83 |
| - "&:nth-child(-n + 2)": { |
84 |
| - md: { |
85 |
| - borderTop: "none", |
| 89 | + [`@media (min-width: ${lgBp})`]: { |
| 90 | + "&:first-child": { |
| 91 | + paddingLeft: 0, |
| 92 | + borderLeft: 0, |
86 | 93 | },
|
87 |
| - lg: { |
| 94 | + "&:nth-child(-n + 2)": { |
88 | 95 | borderTop: "1px solid",
|
89 | 96 | borderTopColor: "searchBackground",
|
90 | 97 | },
|
91 |
| - }, |
92 |
| - "&:nth-child(2n + 1)": { |
93 |
| - md: { |
94 |
| - borderLeft: "none", |
95 |
| - }, |
96 |
| - lg: { |
| 98 | + "&:nth-child(2n + 1)": { |
97 | 99 | borderLeft: "1px solid",
|
98 | 100 | borderLeftColor: "searchBackground",
|
99 | 101 | },
|
100 |
| - }, |
101 |
| - "&:nth-child(-n + 3)": { |
102 |
| - lg: { |
103 |
| - borderTop: "none", |
| 102 | + "&:nth-child(-n + 3)": { |
| 103 | + borderTop: 0, |
104 | 104 | justifyContent: "start",
|
105 | 105 | paddingTop: 0,
|
106 | 106 | },
|
107 |
| - }, |
108 |
| - "&:nth-child(3n + 1)": { |
109 |
| - lg: { |
| 107 | + "&:nth-child(3n + 1)": { |
110 | 108 | paddingLeft: 0,
|
111 |
| - borderLeft: "none", |
| 109 | + borderLeft: 0, |
112 | 110 | },
|
113 |
| - }, |
114 |
| - "&:nth-child(n + 4)": { |
115 |
| - lg: { |
| 111 | + "&:nth-child(n + 4)": { |
116 | 112 | justifyContent: "start",
|
117 | 113 | paddingBottom: 0,
|
118 | 114 | },
|
|
0 commit comments