Skip to content
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: tooltip component design updates #2499

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions dev-client/src/components/tooltips/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,25 @@ import {memo} from 'react';

import {IPopoverProps, Popover} from 'native-base';

import {Text} from 'terraso-mobile-client/components/NativeBaseAdapters';

type TooltipProps = React.PropsWithChildren<{
trigger: IPopoverProps['trigger'];
}>;

export const Tooltip = memo(({trigger, children}: TooltipProps) => {
return (
<Popover trigger={trigger}>
<Popover.Content bg="grey.800" p="0px" shadow="0">
<Popover.Arrow bg="grey.800" shadow="0" />
<Popover.Body
bg="grey.800"
px="8px"
py="4px"
shadow="0"
_text={{color: 'primary.contrast', fontSize: '16px'}}>
{children}
<Popover.Content
borderWidth="0px"
borderRadius="4px"
mx="16px"
maxWidth="328px">
<Popover.Arrow bg="grey.900" borderColor="grey.900" />
<Popover.Body bg="grey.900" px="8px" py="4px">
<Text color="primary.contrast" variant="tooltip-label">
{children}
</Text>
</Popover.Body>
</Popover.Content>
</Popover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ export const CreateSiteForm = ({
{t('site.create.add_to_project_label')}
<HelpContentSpacer />
<HelpButton>
<Text color="primary.contrast" variant="body1">
{t('site.create.add_to_project_tooltip')}
</Text>
{t('site.create.add_to_project_tooltip')}
</HelpButton>
</FormLabel>
<ProjectSelect
Expand Down
6 changes: 6 additions & 0 deletions dev-client/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const theme = extendTheme({
300: '#E0E0E0',
700: '#616161',
800: '#424242',
900: '#212121',
},
action: {
active: '#1A202C',
Expand Down Expand Up @@ -428,6 +429,11 @@ export const theme = extendTheme({
lineHeight: '18px',
letterSpacing: '0.16px',
},
'tooltip-label': {
fontSize: '12px',
lineHeight: '14px',
fontWeight: 500,
},
},
},
Heading: {
Expand Down
Loading