diff --git a/ui/src/components/AdminSettings/AdminSettings.tsx b/ui/src/components/AdminSettings/AdminSettings.tsx new file mode 100644 index 000000000..8937d0f5a --- /dev/null +++ b/ui/src/components/AdminSettings/AdminSettings.tsx @@ -0,0 +1,15 @@ +import BasicTabs from "../UI/BasicTab/BasicTabs"; +import Tab from "../UI/BasicTab/Tab"; + +const AdminSettings: React.FC = () => { + return ( +
+ + USERS + WORKSPACE + +
+ ) +} + +export default AdminSettings; \ No newline at end of file diff --git a/ui/src/components/UI/BasicTab/BasicTabs.tsx b/ui/src/components/UI/BasicTab/BasicTabs.tsx new file mode 100644 index 000000000..e04ed8eaf --- /dev/null +++ b/ui/src/components/UI/BasicTab/BasicTabs.tsx @@ -0,0 +1,37 @@ +import React, { ReactElement, useState } from "react"; +import TabTitle from "./TabTitle"; +import styles from '../style/BasicTabs.module.sass' + + +type Props = { + children: ReactElement[] +} + +const Tabs: React.FC = ({ children }) => { + const [selectedTab, setSelectedTab] = useState(0); + + return ( +
+ + {children[selectedTab]} +
+ ) +} + +export default Tabs \ No newline at end of file diff --git a/ui/src/components/UI/BasicTab/Tab.tsx b/ui/src/components/UI/BasicTab/Tab.tsx new file mode 100644 index 000000000..3263858a6 --- /dev/null +++ b/ui/src/components/UI/BasicTab/Tab.tsx @@ -0,0 +1,11 @@ +import React from 'react' + +type Props = { + title: string +} + +const Tab: React.FC = ({ children }) => { + return
{children}
+} + +export default Tab \ No newline at end of file diff --git a/ui/src/components/UI/BasicTab/TabTitle.tsx b/ui/src/components/UI/BasicTab/TabTitle.tsx new file mode 100644 index 000000000..d89e95ea9 --- /dev/null +++ b/ui/src/components/UI/BasicTab/TabTitle.tsx @@ -0,0 +1,29 @@ +import React, { useCallback } from "react" + +type Props = { + title: string + index: number + setSelectedTab: (index: number) => void +} + +const TabTitle: React.FC = ({ title, setSelectedTab, index }) => { + + const onClick = useCallback(() => { + setSelectedTab(index) + }, [setSelectedTab, index]) + + return ( +
  • +
    {title}
    + +
  • + ) +} + +export default TabTitle \ No newline at end of file diff --git a/ui/src/components/UI/style/BasicTabs.module.sass b/ui/src/components/UI/style/BasicTabs.module.sass new file mode 100644 index 000000000..cffb89719 --- /dev/null +++ b/ui/src/components/UI/style/BasicTabs.module.sass @@ -0,0 +1,33 @@ +@import '../../../variables.module' + +.root + height: 40% + paddingTop: 15px + +.tab + display: 'inline-block' + textTransform: 'uppercase' + color: $blue-color + cursor: 'pointer' + +.tabsAlignLeft + textAlign: 'left' + +.active + color: $font-color + cursor: 'unset' + borderBottom: "2px solid " + $font-color + paddingBottom: 6 + + &.dark + +.disabled + +.highlight + +.separator + borderRight: "1px solid " + 'black' + height: 20 + verticalAlign: 'middle' + margin: '0 20px' + cursor: 'unset'