Skip to content

Commit d4313ed

Browse files
Demo/open mic (#4)
* remove project reference * add Hero component and theme from css * Fixed test Co-authored-by: Roberto Molina <[email protected]>
1 parent e323760 commit d4313ed

File tree

30 files changed

+504
-22
lines changed

30 files changed

+504
-22
lines changed

config/common-paths.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ module.exports = {
2121
locales: path.resolve(__dirname, '..', 'static/locales/'),
2222
images: path.resolve(__dirname, '..', 'static/images/'),
2323
template: path.resolve(__dirname, '..', 'public/index.html'),
24-
// favicon: path.resolve(__dirname, '..', 'public/favicon.ico'),
25-
favicon: path.resolve(__dirname, '..', 'public/amalgam-32x32.png'),
24+
favicon: path.resolve(__dirname, '..', 'public/favicon.ico'),
2625
manifest: path.resolve(__dirname, '..', 'public/manifest.json'),
2726
serviceWorker: path.resolve(__dirname, '..', 'src/', 'service-worker.ts'),
2827
};

public/amalgam-32x32.png

-1.18 KB
Binary file not shown.

public/favicon.ico

8.36 KB
Binary file not shown.

src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import 'theme';
66
import Loading from 'components/Loading';
77
import AppRoutes from 'routes/AppRoutes';
88
import ReactQueryProvider from 'providers/ReactQueryProvider';
9+
import { toggleTheme } from 'utils/utils';
10+
11+
window.toggleTheme = toggleTheme;
912

1013
const App: FC = () => (
1114
<Suspense fallback={<Loading />}>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import styled, { keyframes, css } from 'styled-components';
2+
3+
export const spin = keyframes`
4+
from {
5+
transform: rotate(0deg);
6+
}
7+
8+
to {
9+
transform: rotate(360deg);
10+
}
11+
`;
12+
13+
export const upDown = keyframes`
14+
from {
15+
transform: translate3d(0,25px,0);
16+
}
17+
to {
18+
transform: translate3d(0,-50px,0);
19+
}
20+
`;
21+
22+
export const upDownWide = keyframes`
23+
from {
24+
transform: translate3d(0,0,0);
25+
}
26+
to {
27+
transform: translate3d(0,-150px,0);
28+
}
29+
`;
30+
31+
export const upDownAnimation = css`
32+
animation: ${upDown} 7s ease-in-out infinite alternate;
33+
`;
34+
35+
export const upDownWideAnimation = css`
36+
animation: ${upDownWide} 15s ease-in-out infinite alternate;
37+
`;
38+
39+
export const UpDown = styled.div`
40+
${upDownAnimation};
41+
position: relative;
42+
${(props) => props}
43+
`;
44+
45+
export const UpDownWide = styled.div`
46+
${upDownWideAnimation};
47+
position: relative;
48+
${(props) => props}
49+
`;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import styled from 'styled-components';
2+
3+
export const CircleShape = styled.div`
4+
position: relative;
5+
background-image: linear-gradient(${(props) => `${props.deg}, ${props.primary}, ${props.secondary}`});
6+
border-radius: 9999px;
7+
z-index: 1;
8+
height: 100px;
9+
width: 100px;
10+
${(props) => props};
11+
`;
12+
13+
export default CircleShape;

src/components/Header/Header.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import Header from './Header';
44

55
test('testing i18n in Header', async () => {
66
render(<Header />);
7-
expect(screen.getByText('How it Works')).toBeTruthy();
7+
expect(screen.getByText('Router example')).toBeTruthy();
88
});

src/components/Header/Header.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,29 @@ import { Link, NavLink } from 'react-router-dom';
66
import { Routes } from 'routes/Routes';
77
import Button from 'components/Button';
88
import Sparkles from 'components/Sparkles';
9-
import logo from 'app-assets/images/logo.png';
9+
import NanBrand from 'components/NanBrand';
1010

1111
const Header: FC = () => {
1212
const { t } = useTranslation(['config', 'translations']);
1313
const isFixed = useScroll(50);
14+
1415
return (
1516
<FixedContainer>
1617
<Nav condensed={isFixed}>
1718
<NavContainer>
1819
<Link to={Routes.ROOT}>
19-
<Brand src={logo} alt={t('app.title', { ns: 'config' })} />
20+
<Brand>
21+
<NanBrand />
22+
</Brand>
2023
</Link>
2124

2225
<NavList>
2326
<NavItem>
24-
<NavLink to={Routes.LINKS_EXAMPLES}>{t('header.howItWorks', { ns: 'translations' })}</NavLink>
27+
<NavLink to={Routes.LINKS_EXAMPLES}>{t('header.routerLinkExample', { ns: 'translations' })}</NavLink>
2528
</NavItem>
2629
<NavItem>
2730
<NavLink to={Routes.API_EXAMPLES}>{t('header.integrations', { ns: 'translations' })}</NavLink>
2831
</NavItem>
29-
<NavItem>{t('header.pricing', { ns: 'translations' })}</NavItem>
30-
<NavItem>{t('header.aboutUs', { ns: 'translations' })}</NavItem>
3132
</NavList>
3233

3334
<Sparkles colors={['#FFC700', '#22d0b6', '#22d0b6', '#80a6e9', '#f280b9', '#e35da0', '#0cea86']}>

src/components/Header/styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const Nav = styled.nav<NavProps>`
2121
color: black;
2222
background-color: #fefefe;
2323
transition: all 0.2s ease-in-out 0s;
24-
padding: ${({ condensed }) => (condensed ? '20px 0' : '60px 20px')};
24+
padding: ${({ condensed }) => (condensed ? '20px 0' : '40px 20px')};
2525
box-shadow: ${({ condensed }) => (condensed ? '0 2px 10px 0 rgba(36, 50, 66, 0.075)' : 'none')};
2626
`;
2727

@@ -34,7 +34,7 @@ export const NavContainer = styled.div`
3434
padding: 0 20px;
3535
`;
3636

37-
export const Brand = styled.img`
37+
export const Brand = styled.div`
3838
padding-right: 20px;
3939
`;
4040

src/components/Hero/index.jsx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import React from 'react';
2+
import logo from 'app-assets/images/react.svg';
3+
import NanLabsIcon from 'components/NanLabsIcon';
4+
import ShapeBackground from 'components/ShapeBackground';
5+
import useWindowSize from 'hooks/useWindowSize';
6+
7+
import {
8+
Root,
9+
HeroContainer,
10+
TextContainer,
11+
Title,
12+
Subtitle,
13+
IllustrationContainer,
14+
Image,
15+
ImageContainer,
16+
} from './styles.js';
17+
18+
const Hero = () => {
19+
const windowSize = useWindowSize();
20+
const showIllustration = windowSize.width > 1200;
21+
22+
console.log('showIllustration', showIllustration);
23+
24+
return (
25+
<Root>
26+
<HeroContainer>
27+
<TextContainer fullWidth={!showIllustration}>
28+
<Title>Agregar un titulo</Title>
29+
<Subtitle>Agregar un subtitulo</Subtitle>
30+
</TextContainer>
31+
{showIllustration && (
32+
<IllustrationContainer>
33+
<Image src={logo} position="absolute" alt="logo" top="-12vw" right="-5vw" height="21vw" />
34+
<ImageContainer top="1vw" right="10vw">
35+
<NanLabsIcon
36+
fill={'#5d73f5'}
37+
width="17vw"
38+
height="17vw"
39+
filter={'drop-shadow( 3px 3px 2px rgba(0, 0, 0, .4))'}
40+
/>
41+
</ImageContainer>
42+
</IllustrationContainer>
43+
)}
44+
<ShapeBackground />
45+
</HeroContainer>
46+
</Root>
47+
);
48+
};
49+
export default Hero;

0 commit comments

Comments
 (0)