Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2540135800_NicholasHansMuliawan #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=e01b7895a403fa7364061b2f01a650fc
BACKEND_API_HOST=https://demo.duendesoftware.com
BACKEND_CUSTOM_API_HOST=https://new-dev.accelist.com:1234
OIDC_ISSUER=https://demo.duendesoftware.com
OIDC_CLIENT_ID=interactive.public.short
OIDC_SCOPE=openid profile email api offline_access
2 changes: 2 additions & 0 deletions appsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ module.exports = {
oidcIssuer: process.env['OIDC_ISSUER'] ?? '',
oidcClientId: process.env['OIDC_CLIENT_ID'] ?? '',
oidcScope: process.env['OIDC_SCOPE'] ?? '',
backendCustomApiHost: process.env['BACKEND_CUSTOM_API_HOST'] ?? '',
// BACKEND_CUSTOM_API_HOST
};
121 changes: 51 additions & 70 deletions components/DefautLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useState } from "react";
import Head from 'next/head';
import { Avatar, Button, ConfigProvider, Drawer, Layout, Menu, MenuProps } from "antd";
import { faBars, faSignOut, faSignIn, faHome, faCubes, faUser, faUsers, faFlaskVial } from '@fortawesome/free-solid-svg-icons'
import { faBars, faSignOut, faSignIn, faHome, faUser, faCircleUp } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useRouter } from "next/router";
import { useSession, signIn, signOut } from "next-auth/react";
import { useSession, signOut } from "next-auth/react";
import nProgress from "nprogress";

const { Content, Sider } = Layout;
Expand Down Expand Up @@ -36,71 +36,55 @@ const DefaultLayout: React.FC<{

menu.push(
{
key: '#menu-1',
label: 'Menu 1',
icon: <FontAwesomeIcon icon={faCubes}></FontAwesomeIcon>,
children: [
{
key: '/dashboard',
label: 'Dashboard',
onClick: () => router.push('/dashboard')
},
{
key: '/sub-menu-b',
label: 'Sub Menu B',
onClick: () => router.push('/')
},
{
key: '/sub-menu-c',
label: 'Sub Menu C',
onClick: () => router.push('/')
}
]
key: 'Post',
label: 'Post',
icon: <FontAwesomeIcon icon={faCircleUp} />,
onClick: () => router.push('/create')
},
{
key: '#menu-2',
label: 'Menu 2',
icon: <FontAwesomeIcon icon={faUsers}></FontAwesomeIcon>,
children: [
{
key: '/sub-menu-d',
label: 'Sub Menu D',
onClick: () => router.push('/')
},
{
key: '/sub-menu-e',
label: 'Sub Menu E',
onClick: () => router.push('/')
},
{
key: '/sub-menu-f',
label: 'Sub Menu F',
onClick: () => router.push('/')
}
]
},
{
key: '#menu-3',
label: 'Menu 3',
icon: <FontAwesomeIcon icon={faFlaskVial}></FontAwesomeIcon>,
children: [
{
key: '/sub-menu-g',
label: 'Sub Menu G',
onClick: () => router.push('/')
},
{
key: '/sub-menu-h',
label: 'Sub Menu H',
onClick: () => router.push('/')
},
{
key: '/sub-menu-i',
label: 'Sub Menu I',
onClick: () => router.push('/')
}
]
}
// {
// key: '#menu-2',
// label: 'Menu 2',
// icon: <FontAwesomeIcon icon={faUsers}></FontAwesomeIcon>,
// children: [
// {
// key: '/sub-menu-d',
// label: 'Sub Menu D',
// onClick: () => router.push('/')
// },
// {
// key: '/sub-menu-e',
// label: 'Sub Menu E',
// onClick: () => router.push('/')
// },
// {
// key: '/sub-menu-f',
// label: 'Sub Menu F',
// onClick: () => router.push('/')
// }
// ]
// },
// {
// key: '#menu-3',
// label: 'Menu 3',
// icon: <FontAwesomeIcon icon={faFlaskVial}></FontAwesomeIcon>,
// children: [
// {
// key: '/sub-menu-g',
// label: 'Sub Menu G',
// onClick: () => router.push('/')
// },
// {
// key: '/sub-menu-h',
// label: 'Sub Menu H',
// onClick: () => router.push('/')
// },
// {
// key: '/sub-menu-i',
// label: 'Sub Menu I',
// onClick: () => router.push('/')
// }
// ]
// }
);

if (status === 'authenticated') {
Expand All @@ -122,10 +106,7 @@ const DefaultLayout: React.FC<{
key: '/sign-in',
label: 'Sign in',
icon: <FontAwesomeIcon icon={faSignIn}></FontAwesomeIcon>,
onClick: () => {
nProgress.start();
signIn('oidc');
}
onClick: () => router.push('/login')
});
}

Expand Down
Loading
Loading