-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: redesign - search component #1994
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
e2ba48d
to
b353e9a
Compare
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
b353e9a
to
4009e76
Compare
4009e76
to
f4fcd7a
Compare
f4fcd7a
to
2d2fcbe
Compare
2d2fcbe
to
95ea9dc
Compare
95ea9dc
to
7c66c76
Compare
It would be nice to see a PR description with relevant details |
@@ -0,0 +1,243 @@ | |||
import { Flex, FlexProps, Icon } from '@chakra-ui/react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of this file has a typo
|
||
export function ResultItem({ value }: { value: string }) { | ||
return ( | ||
<ResultItemWrapper> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every ResultItem in this file basically looks the same to me. It looks like:
<ResultItemWrapper>
<Flex gap={4} flex={'1 1 auto'} minWidth={0}>
<SearchLink href={'#'}>
some text
</SearchLink>
<SomeCustomComponentPieces />
</Flex>
<ResultItemIcon type={'arrow'} />
</ResultItemWrapper>
Can you see if it's possible to write one component for all of these and that just takes the tx type and uses it to render the specific <SomeCustomComponentPieces />
it needs?
7c66c76
to
973811d
Compare
Looking good @He1DAr! I've added some style fixes in the images; hopefully everything is clear, but please ask me if you have any questions. One additional point: when I focus on the search bar, the "type in" bar appears white and becomes hard to see. Not sure if this is a Storybook preview issue, but just something to check: ![]() ![]() |
973811d
to
a468e8c
Compare
|
||
export function SearchResultsWrapper({ children }: { children: ReactNode }) { | ||
return ( | ||
<Flex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever using flex and flexdirection column we should be using Stack
flexDirection={'column'} | ||
position={'absolute'} | ||
background={'surfaceSecondary'} | ||
left={'calc(-1 * var(--stacks-spacing-3))'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does -3 not work? Otherwise, it might work if you put -3 in the spacing config for the theme
left={'calc(-1 * var(--stacks-spacing-3))'} | ||
right={'calc(-1 * var(--stacks-spacing-3))'} | ||
top={'calc(-1 * var(--stacks-spacing-3))'} | ||
borderRadius={'1.125rem'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should be using the theme vars
right={'calc(-1 * var(--stacks-spacing-3))'} | ||
top={'calc(-1 * var(--stacks-spacing-3))'} | ||
borderRadius={'1.125rem'} | ||
boxShadow={'0px 16px 32px 0px rgba(184, 180, 176, 0.20)'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a theme var for this
function DocsLink() { | ||
return ( | ||
<SearchLink gap={1} lineHeight={'base'}> | ||
<Icon w={4} h={4}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no color?
src/app/_components/Search/TxTag.tsx
Outdated
export function TxTag({ type }: { type: 'confirmed' | 'pending' | 'failed' }) { | ||
return ( | ||
<Flex | ||
display={'flex'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unneccessary
py: 1.5, | ||
px: 2, | ||
border: '2px solid var(--stacks-colors-new-border-secondary)', | ||
borderRadius: 'md', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redesing.md?
src/ui/theme/recipes/KbdRecipe.ts
Outdated
pl: 1.5, | ||
pr: 2, | ||
py: 1, | ||
borderRadius: 'md', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redesign.md?
src/ui/theme/semanticTokens.ts
Outdated
search: { | ||
input: { | ||
background: { | ||
value: { base: '{colors.slate.150}', _dark: '{colors.slate.850}' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless these values are going into an svg, you can probably remove this and add this object inline
@@ -19,8 +24,15 @@ export const searchSlice = createSlice({ | |||
setSearchTerm: (state, action: PayloadAction<string>) => { | |||
state.searchTerm = action.payload; | |||
}, | |||
setTempSearchTerm: (state, action: PayloadAction<string>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like either TempSearchTerm and SearchPreviewScrollLeft need better names or they need comments somewhere, as it was difficult through this PR to understand what they did
a468e8c
to
2a416fe
Compare
2a416fe
to
b8f8c4d
Compare
b8f8c4d
to
f3d032f
Compare
3cb5286
to
47b6f92
Compare
47b6f92
to
ae73218
Compare
ae73218
to
fad0fa2
Compare
fad0fa2
to
a7fcb8c
Compare
What type of PR is this? (check all applicable)
Description
Search component redesign
Issue ticket number and link
#1961
Checklist:
Screenshots (if appropriate):