From e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Mon, 16 Nov 2020 00:10:28 +0100 Subject: api, login, auth --- client/src/admin/jsx/App.jsx | 36 ++++++++++++++++++++++++++++++++++ client/src/admin/jsx/MainScreen.jsx | 25 +++++++++++++++++++++++ client/src/admin/scss/_mainScreen.scss | 30 ++++++++++++++++++++++++++++ client/src/admin/scss/index.scss | 8 ++++++++ 4 files changed, 99 insertions(+) create mode 100644 client/src/admin/jsx/App.jsx create mode 100644 client/src/admin/jsx/MainScreen.jsx create mode 100644 client/src/admin/scss/_mainScreen.scss create mode 100644 client/src/admin/scss/index.scss (limited to 'client/src/admin') diff --git a/client/src/admin/jsx/App.jsx b/client/src/admin/jsx/App.jsx new file mode 100644 index 0000000..c5be77c --- /dev/null +++ b/client/src/admin/jsx/App.jsx @@ -0,0 +1,36 @@ +import React, { useState, useEffect } from 'react'; +import ReactDOM from 'react-dom'; + +import "../scss/index.scss"; + +import texts from '../../common/data/texts.js'; +import TopBar from '../../common/jsx/TopBar.jsx'; +import Info from '../../common/jsx/Info.jsx'; +import MainScreen from './MainScreen.jsx'; + +const App = () => { + const [adminLang, setAdminLang] = useState('en'); + const [projects, setProjects] = useState([]); + const [info, setInfo] = useState(''); + const [hover, setHover] = useState(''); + const [view, setView] = useState('main'); + const [user, setUser] = useState(null); + const t = (key) => texts[adminLang][key] || texts['en'][key]; + + // useEffect(() => { + // setInfo('no-saved-websites') + // setHover(''); + // }, [user]); + + return ( +
+ +
+ { view === 'main' && } +
+ +
+ ) +}; + +ReactDOM.render(, document.getElementById('app')); diff --git a/client/src/admin/jsx/MainScreen.jsx b/client/src/admin/jsx/MainScreen.jsx new file mode 100644 index 0000000..ff28256 --- /dev/null +++ b/client/src/admin/jsx/MainScreen.jsx @@ -0,0 +1,25 @@ +import React, { Fragment } from 'react'; +import WithHover from '../../common/jsx/WithHover.jsx'; + +const MainScreen = ({ projects, t, setHover }) => ( +
+

{ t('main-title') }

+
+ { !projects.length && ( + +

{ t('edit-current-project') }

+
+ )} + { !projects.length && ( + +

{ t('show-saved-projects') }

+
+ )} + +

{ t('create-new-project') }

+
+
+
+); + +export default MainScreen; diff --git a/client/src/admin/scss/_mainScreen.scss b/client/src/admin/scss/_mainScreen.scss new file mode 100644 index 0000000..4eec73a --- /dev/null +++ b/client/src/admin/scss/_mainScreen.scss @@ -0,0 +1,30 @@ +.main-screen { + text-align: center; + + &__header { + display: block; + margin-top: 10vh; + margin-bottom: 20vh; + font-size: 300%; + color: white; + text-align: center; + } + + &__list { + display: inline-block; + } + + &__item { + font-size: 175%; + color: white; + transition: color .3s; + cursor: pointer; + margin-top: 5vh; + margin-bottom: 5vh; + + &:hover { + color: $text-selected; + } + } + +} diff --git a/client/src/admin/scss/index.scss b/client/src/admin/scss/index.scss new file mode 100644 index 0000000..67553bb --- /dev/null +++ b/client/src/admin/scss/index.scss @@ -0,0 +1,8 @@ +@import '../../common/scss/reset'; +@import '../../common/scss/colors'; +@import '../../common/scss/globals'; +@import '../../common/scss/forms'; +@import '../../common/scss/main'; +@import '../../common/scss/info'; +@import '../../common/scss/topBar'; +@import 'mainScreen'; -- cgit v1.2.3