From 912957405bd2c90e7a6f3e07ced9cd0d8163cc78 Mon Sep 17 00:00:00 2001 From: Phuoc Nguyen Date: Fri, 22 Nov 2019 19:16:27 +0700 Subject: [PATCH] Add dot navigation --- client/App.jsx | 2 + client/Home.jsx | 7 ++ client/layouts/dot-navigation/Cover.jsx | 20 ++++++ client/layouts/dot-navigation/Details.jsx | 78 +++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 client/layouts/dot-navigation/Cover.jsx create mode 100644 client/layouts/dot-navigation/Details.jsx diff --git a/client/App.jsx b/client/App.jsx index 5683529..41ba1f1 100644 --- a/client/App.jsx +++ b/client/App.jsx @@ -9,6 +9,7 @@ import Breadcrumb from './layouts/breadcrumb/Details'; import ButtonWithIcon from './layouts/button-with-icon/Details'; import Card from './layouts/card/Details'; import Centering from './layouts/centering/Details'; +import DotNavigation from './layouts/dot-navigation/Details'; import FeatureList from './layouts/feature-list/Details'; import FixedAtCorner from './layouts/fixed-at-corner/Details'; import HolyGrail from './layouts/holy-grail/Details'; @@ -45,6 +46,7 @@ const App = () => { + diff --git a/client/Home.jsx b/client/Home.jsx index 7ba61d7..e4cfbca 100644 --- a/client/Home.jsx +++ b/client/Home.jsx @@ -6,6 +6,7 @@ import BreadcrumbCover from './layouts/breadcrumb/Cover'; import ButtonWithIconCover from './layouts/button-with-icon/Cover'; import CardCover from './layouts/card/Cover'; import CenterCover from './layouts/centering/Cover'; +import DotNavigationCover from './layouts/dot-navigation/Cover'; import FeatureListCover from './layouts/feature-list/Cover'; import FixedAtCornerCover from './layouts/fixed-at-corner/Cover'; import HolyGrailCover from './layouts/holy-grail/Cover'; @@ -142,6 +143,12 @@ const Home = () => {

Centering

+
+ + +

Dot navigation

+ +
diff --git a/client/layouts/dot-navigation/Cover.jsx b/client/layouts/dot-navigation/Cover.jsx new file mode 100644 index 0000000..a9ed22e --- /dev/null +++ b/client/layouts/dot-navigation/Cover.jsx @@ -0,0 +1,20 @@ +import React from 'react'; + +import Frame from '../../placeholders/Frame'; + +const Cover = () => { + return ( + +
+
+
+
+
+
+
+
+ + ); +}; + +export default Cover; diff --git a/client/layouts/dot-navigation/Details.jsx b/client/layouts/dot-navigation/Details.jsx new file mode 100644 index 0000000..d2cc91c --- /dev/null +++ b/client/layouts/dot-navigation/Details.jsx @@ -0,0 +1,78 @@ +import React, { useState } from 'react'; + +import DetailsLayout from '../../DetailsLayout'; +import BrowserFrame from '../../placeholders/BrowserFrame'; +import SampleCode from '../../SampleCode'; + +const Details = () => { + const [activeItem, setActiveItem] = useState(0); + + const Dot = ({ index }) => { + const isActive = index === activeItem; + const click = () => setActiveItem(index); + return ( +
  • + ); + }; + + return ( + + +
      + + + + +
    +
  • + } + source={ + +
  • +
  • +`} +/> + } + /> + + ); +}; + +export default Details;