From a3adcfc3daa38333046d0f33b3d16379613f95d8 Mon Sep 17 00:00:00 2001 From: Davor Date: Mon, 25 Jul 2022 23:50:23 +0200 Subject: [PATCH] modifed css on AppSingle --- src/App.tsx | 3 +- src/modules/apps/AppSingle.tsx | 106 ++++------- .../apps/components/GeneralTab/GeneralTab.tsx | 171 +++--------------- src/modules/apps/consts.tsx | 12 +- 4 files changed, 74 insertions(+), 218 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 83fedd3..7d2d7e1 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,7 +4,7 @@ import { Routes, Route, Navigate, Outlet } from 'react-router-dom'; import { Toaster } from 'react-hot-toast'; import { useAuth } from 'src/services/auth'; -import { Dashboard, Users, Login, Apps } from './modules'; +import { Dashboard, Users, Login, Apps, AppSingle } from './modules'; import { Layout } from './components'; import { LoginCallback } from './modules/login/LoginCallback'; @@ -46,6 +46,7 @@ function App() { } /> }> + } /> } /> } /> diff --git a/src/modules/apps/AppSingle.tsx b/src/modules/apps/AppSingle.tsx index fc994e3..a3602e9 100644 --- a/src/modules/apps/AppSingle.tsx +++ b/src/modules/apps/AppSingle.tsx @@ -1,8 +1,9 @@ import React from 'react'; -import { ChevronRightIcon } from '@heroicons/react/solid'; +import { useParams } from 'react-router-dom'; +import _ from 'lodash'; import { XCircleIcon } from '@heroicons/react/outline'; -import { Tabs, Banner } from 'src/components'; -import { Link } from 'react-router-dom'; +import { Tabs } from 'src/components'; +import { appAccessList } from 'src/components/UserModal/consts'; import { AdvancedTab, GeneralTab } from './components'; const pages = [ @@ -16,81 +17,46 @@ const tabs = [ ]; export const AppSingle: React.FC = () => { + const params = useParams(); + const appSlug = params.slug; + + const appInfo = _.find(appAccessList, { name: appSlug }); + return ( - <> -
- -
- -
- -
- -
-
-
-
- Nextcloud - -
-

Nextcloud

-
Installed on August 25, 2020
-
-
- -
- - - -
+
+
+
+ {appInfo?.label} +
+

{appInfo?.label}

+
Installed on August 25, 2020
+ +
+
-
+
+
- +
); }; diff --git a/src/modules/apps/components/GeneralTab/GeneralTab.tsx b/src/modules/apps/components/GeneralTab/GeneralTab.tsx index 1e5239b..bdc9317 100644 --- a/src/modules/apps/components/GeneralTab/GeneralTab.tsx +++ b/src/modules/apps/components/GeneralTab/GeneralTab.tsx @@ -1,159 +1,40 @@ import React, { useState } from 'react'; -import { RadioGroup } from '@headlessui/react'; +import { Switch } from '@headlessui/react'; function classNames(...classes: any) { return classes.filter(Boolean).join(' '); } -const settings = [ - { name: 'Public access', description: 'This project would be available to anyone who has the link' }, - { name: 'Private to Project Members', description: 'Only members of this project would be able to access' }, - { name: 'Private to you', description: 'You are the only one able to access this project' }, -]; - export const GeneralTab = () => { - const [selected, setSelected] = useState(settings[0]); + const [enabled, setEnabled] = useState(false); return (
-
-
-
-

Privacy

-

Change your app privacy

-
- -
-
- - Privacy setting -
- {settings.map((setting, settingIdx) => ( - - classNames( - settingIdx === 0 ? 'rounded-tl-md rounded-tr-md' : '', - settingIdx === settings.length - 1 ? 'rounded-bl-md rounded-br-md' : '', - checked ? 'bg-primary-50 border-primary-400 z-10' : 'border-gray-200', - 'relative border p-4 flex cursor-pointer focus:outline-none', - ) - } - > - {({ active, checked }) => ( - <> - - ))} -
-
-
-
+
+
+

Automatic updates

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et nibh sit amet mauris faucibus molestie + gravida at orci. +

-
- -
-
-
-

Notifications

-

Change you notifications settings

-
- -
-
- Notifications -
-
- -
-
- -

- Get notified when someones posts a comment on a posting. -

-
-
-
-
-
- -
-
- -

- Get notified when a candidate applies for a job. -

-
-
-
-
-
-
- -
-
- -

- Get notified when a candidate accepts or rejects an offer. -

-
-
-
-
-
+
+ +
diff --git a/src/modules/apps/consts.tsx b/src/modules/apps/consts.tsx index 7f58f33..1d6119d 100644 --- a/src/modules/apps/consts.tsx +++ b/src/modules/apps/consts.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { CogIcon, PlusCircleIcon } from '@heroicons/react/outline'; import _ from 'lodash'; +import { useNavigate } from 'react-router'; export const initialEditorYaml = () => { return `luck: except @@ -93,14 +94,16 @@ export const columns: any = [ { Header: ' ', Cell: (e: any) => { + const navigate = useNavigate(); const appStatus = e.cell.row.original.status as AppStatus; + const appSlug = e.cell.row.original.slug; if (appStatus === AppStatus.Installing) { return null; } return (