Skip to content

Commit 99aa39a

Browse files
committed
Info button added
1 parent 1f429ad commit 99aa39a

File tree

3 files changed

+59
-13
lines changed

3 files changed

+59
-13
lines changed

Diff for: components/ui/HtmlTooltip.tsx

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { styled } from '@mui/material/styles';
2+
3+
import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip';
4+
5+
export const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => (
6+
<Tooltip {...props} classes={{ popper: className }} />
7+
))(({ theme }) => ({
8+
[`& .${tooltipClasses.tooltip}`]: {
9+
backgroundColor: '#f5f5f9',
10+
color: 'rgba(0, 0, 0, 0.87)',
11+
maxWidth: 220,
12+
fontSize: theme.typography.pxToRem(12),
13+
border: '1px solid #dadde9',
14+
},
15+
}));

Diff for: components/ui/Navbar.tsx

+43-13
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
IconButton,
88
InputBase,
99
Link,
10+
ListItem,
1011
Toolbar,
1112
Typography,
1213
} from '@mui/material';
@@ -18,10 +19,12 @@ import {
1819
AiOutlineTwitter,
1920
AiOutlineGlobal,
2021
AiOutlineMenu,
22+
AiFillInfoCircle,
2123
} from 'react-icons/ai';
2224
import SearchIcon from '@mui/icons-material/Search';
2325

2426
import { grey } from '@mui/material/colors';
27+
import { HtmlTooltip } from './HtmlTooltip';
2528

2629
interface Props {
2730
onChange?: (value: ChangeEvent<HTMLInputElement>) => void;
@@ -94,13 +97,13 @@ export const Navbar = ({ onChange }: Props) => {
9497
<AppBar>
9598
<Toolbar>
9699
{/* Drawer menu */}
97-
{/* <NextLink href={'/'} passHref>
100+
<NextLink href={'/'} passHref>
98101
<Link>
99102
<IconButton>
100103
<AiOutlineMenu />
101104
</IconButton>
102105
</Link>
103-
</NextLink> */}
106+
</NextLink>
104107

105108
<NextLink href={'/'} passHref>
106109
<Link
@@ -115,28 +118,55 @@ export const Navbar = ({ onChange }: Props) => {
115118
<Box flex={1} />
116119

117120
<Box sx={{ display: { xs: 'block' } }}>
118-
<IconButton onClick={gitHubLink}>
119-
<AiOutlineGithub />
120-
</IconButton>
121+
<HtmlTooltip
122+
title={
123+
<>
124+
<Typography variant='subtitle1' color='inherit'>
125+
Directory App
126+
</Typography>
127+
<Typography variant='subtitle2'>
128+
Is an easy & quick search to find google fonts using{' '}
129+
<NextLink
130+
href='https://github.com/expo/google-fonts'
131+
passHref
132+
>
133+
<a target='_blank'>@expo-google-fonts</a>
134+
</NextLink>{' '}
135+
for your React Native App. Developed with ❤️ by{' '}
136+
<NextLink href='https://atiladev.com/en' passHref>
137+
<a target='_blank'>AtilaDev</a>
138+
</NextLink>
139+
</Typography>
140+
</>
141+
}
142+
>
143+
<IconButton>
144+
<AiFillInfoCircle />
145+
</IconButton>
146+
</HtmlTooltip>
121147

122-
<IconButton onClick={linkedInLink}>
123-
<AiOutlineLinkedin />
148+
<IconButton onClick={atilaDevLink}>
149+
<AiOutlineGlobal />
124150
</IconButton>
125151

126152
{/* Put inside of Drawer in the future */}
127153
<Grid item sx={{ display: { xs: 'none', sm: 'inline' } }}>
128-
<IconButton onClick={atilaDevLink}>
129-
<AiOutlineGlobal />
154+
<IconButton onClick={gitHubLink}>
155+
<AiOutlineGithub />
156+
</IconButton>
157+
158+
<IconButton onClick={linkedInLink}>
159+
<AiOutlineLinkedin />
130160
</IconButton>
131161

132162
<IconButton onClick={twitterLink}>
133163
<AiOutlineTwitter />
134164
</IconButton>
135-
</Grid>
136165

137-
<IconButton onClick={mailLink}>
138-
<AiOutlineMail />
139-
</IconButton>
166+
<IconButton onClick={mailLink}>
167+
<AiOutlineMail />
168+
</IconButton>
169+
</Grid>
140170
</Box>
141171

142172
<Box borderColor={'black'}>

Diff for: components/ui/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from './Navbar';
22
export * from './ListItem';
3+
export * from './HtmlTooltip';

0 commit comments

Comments
 (0)