diff --git a/.gitignore b/.gitignore
index 90a51d0..38046fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,13 @@ npm-debug.log*
.firebase.json
.vercel
+
+# OS generated files #
+######################
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
diff --git a/README.md b/README.md
index 771ec52..ce70ab1 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@ This project is a simplified front end clone of Netflix. It was created with Rea
- [x] Migrate to Typescript
- [ ] Implement dynamic code splitting with dynamic imports
- [ ] Setup storybook
+- [ ] Implement internationalization with react-i18next
### Tools used
diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx
index 07de8aa..e8cc016 100644
--- a/src/components/Button/Button.tsx
+++ b/src/components/Button/Button.tsx
@@ -3,6 +3,7 @@ import './button.scss'
export enum ButtonType {
Primary,
Secondary,
+ IconRound,
}
interface IButton {
diff --git a/src/components/Button/__tests__/Button.stories.tsx b/src/components/Button/__tests__/Button.stories.tsx
index 3912dc4..0ac7bde 100644
--- a/src/components/Button/__tests__/Button.stories.tsx
+++ b/src/components/Button/__tests__/Button.stories.tsx
@@ -54,3 +54,9 @@ SecondaryWithIcon.args = {
buttonType: ButtonType.Secondary,
Icon: ,
}
+
+export const IconRound = Template.bind({})
+IconRound.args = {
+ ButtonType: ButtonType.IconRound,
+ Icon: ,
+}
diff --git a/src/components/Button/button.scss b/src/components/Button/button.scss
index a2c8190..9078878 100644
--- a/src/components/Button/button.scss
+++ b/src/components/Button/button.scss
@@ -75,5 +75,37 @@
&.Secondary {
background-color: rgba(109, 109, 110, 0.7);
color: #fff;
+
+ &:not(:disabled):hover {
+ background-color: rgba(109, 109, 110, 0.4);
+ }
+
+ &:not(:disabled):active {
+ background-color: rgba(109, 109, 110, 0.4);
+ color: rgba(255, 255, 255, 0.7);
+ }
+
+ &:not(:disabled):focus::before {
+ box-sizing: content-box;
+ content: '';
+ display: block;
+ height: 100%;
+ width: 100%;
+ border: 2px solid white;
+ border-radius: 8px;
+ padding: 2px;
+ position: absolute;
+ left: -4px;
+ top: -4px;
+ }
+ }
+
+ &.IconRound {
+ background-color: rgba(42, 42, 42, 0.6);
+ border-color: hsla(0, 0%, 100%, 0.5);
+ border-width: 2px;
+ & > * {
+ fill: #fff;
+ }
}
}
diff --git a/src/components/Header.tsx b/src/components/Header.tsx
index f344827..9d56686 100644
--- a/src/components/Header.tsx
+++ b/src/components/Header.tsx
@@ -29,13 +29,13 @@ const Header = ({ name, overview }: IHeader) => {
url='https://vimeo.com/384025132'
/>
{name}
+ } />
}
buttonType={ButtonType.Primary}
onClick={() => console.log('not a movie!')}
label={'Play'}
/>
-
{isMuted ? (
setIsMuted(false)}
diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx
index 122d923..e3ea169 100644
--- a/src/components/Navbar.tsx
+++ b/src/components/Navbar.tsx
@@ -5,9 +5,12 @@ import { useNavigate } from 'react-router-dom'
import { useScroll } from '../hooks/useScroll'
import SearchLogo from '../static/images/search-icon.svg'
import NetflixLogo from '../static/images/Netflix_Logo_RGB.png'
+import AddLogo from '../static/images/add.svg'
import BellLogo from '../static/images/bell-logo.svg'
import DropdownArrow from '../static/images/drop-down-arrow.svg'
import DropdownContent from './DropdownContent'
+import Button from './Button/Button'
+import { ButtonType } from './Button/Button'
const Navbar = () => {
const navigate = useNavigate()
@@ -64,7 +67,7 @@ const Navbar = () => {
placeholder='Title, genres, people'
/>
-
+ } />
KIDS
DVD
diff --git a/src/fonts/NetflixSans_W_Bd.woff2 b/src/fonts/NetflixSans_W_Bd.woff2
new file mode 100644
index 0000000..8d89318
Binary files /dev/null and b/src/fonts/NetflixSans_W_Bd.woff2 differ
diff --git a/src/fonts/NetflixSans_W_Md.woff2 b/src/fonts/NetflixSans_W_Md.woff2
new file mode 100644
index 0000000..4cf3471
Binary files /dev/null and b/src/fonts/NetflixSans_W_Md.woff2 differ
diff --git a/src/fonts/NetflixSans_W_Rg.woff2 b/src/fonts/NetflixSans_W_Rg.woff2
new file mode 100644
index 0000000..fcc8ca6
Binary files /dev/null and b/src/fonts/NetflixSans_W_Rg.woff2 differ
diff --git a/src/static/images/add-round.svg b/src/static/images/add-round.svg
new file mode 100644
index 0000000..7ae4462
--- /dev/null
+++ b/src/static/images/add-round.svg
@@ -0,0 +1 @@
+
diff --git a/src/static/sass/base/_base.scss b/src/static/sass/base/_base.scss
index fb850ac..3ea5764 100644
--- a/src/static/sass/base/_base.scss
+++ b/src/static/sass/base/_base.scss
@@ -124,8 +124,16 @@
border-spacing: 0;
}
+@font-face {
+ font-family: 'Netflix Sans';
+ src: url('../../../fonts/NetflixSans_W_Bd.woff2') format('woff2');
+ // url('~/fonts/NetflixSans_W_Md.woff2') format('woff2'),
+ // url('~/fonts/NetflixSans_W_Bd.woff2') format('woff2');
+}
+
body {
- font-family: 'Hind', sans-serif;
+ font-family: 'Netflix Sans', 'Helvetica Neue', 'Segoe UI', 'Roboto', 'Ubuntu',
+ 'sans-serif';
box-sizing: border-box;
background-color: $color-background;
}
diff --git a/src/static/sass/layout/_header.scss b/src/static/sass/layout/_header.scss
index 9b56507..9ad361c 100644
--- a/src/static/sass/layout/_header.scss
+++ b/src/static/sass/layout/_header.scss
@@ -13,6 +13,11 @@
position: absolute;
}
+ & > button.IconRound {
+ left: 18.5rem;
+ position: absolute;
+ }
+
@include responsive(phone) {
padding-top: 0;
height: 32rem;
diff --git a/webpack.config.js b/webpack.config.js
index d77e180..1afc61c 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -2,14 +2,13 @@ const HtmlWebPackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
-const TerserPlugin = require('terser-webpack-plugin')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const dotenv = require('dotenv')
const webpack = require('webpack')
+const path = require('path')
const prod =
(process.env.NODE_ENV ? process.env.NODE_ENV : '').trim() === 'production'
-const path = require('path')
module.exports = () => {
dotenv.config({
@@ -21,10 +20,10 @@ module.exports = () => {
output: {
filename: '[name].[contenthash].js',
path: path.resolve(__dirname, 'dist'),
- clean: true,
+ assetModuleFilename: 'assets/[name][ext]',
},
resolve: {
- extensions: ['.tsx', '.ts', '.js'],
+ extensions: ['.js', '.ts', '.tsx'],
},
optimization: {
runtimeChunk: 'single',
@@ -67,7 +66,15 @@ module.exports = () => {
patterns: [
{
from: 'src/static/images',
- to: 'static/images',
+ to: 'resources/',
+ },
+ ],
+ }),
+ new CopyWebpackPlugin({
+ patterns: [
+ {
+ from: 'src/fonts',
+ to: 'fonts/',
},
],
}),
@@ -96,19 +103,15 @@ module.exports = () => {
use: ['@svgr/webpack'],
},
{
- test: /\.css$/i,
- use: [MiniCssExtractPlugin.loader, 'css-loader'],
- },
- {
- test: /\.scss$/,
+ test: /\.(sass|less|css|scss)$/,
+ // include: path.resolve(__dirname),
use: [
- {
- loader: MiniCssExtractPlugin.loader,
- options: {
- publicPath: '../',
- },
- },
+ // fallback to style-loader in development
+ process.env.NODE_ENV !== 'production'
+ ? 'style-loader'
+ : MiniCssExtractPlugin.loader,
'css-loader',
+ 'resolve-url-loader',
'sass-loader',
],
},
@@ -125,6 +128,14 @@ module.exports = () => {
},
],
},
+ {
+ test: /\.(woff|woff2|eot|ttf|otf)$/,
+ // include: path.resolve(__dirname),
+ type: 'asset/resource',
+ generator: {
+ filename: './fonts/[name][ext]',
+ },
+ },
],
},
}