Skip to content

Commit

Permalink
Added SignOut
Browse files Browse the repository at this point in the history
  • Loading branch information
linxiaoxin committed Jun 22, 2024
1 parent f8149db commit 273510e
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 267 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ NEXT_PUBLIC_IDP_AuthorizeEndpoint = $NEXT_PUBLIC_COGNITO_URL/oauth2/authorize
NEXT_PUBLIC_IDP_Tokendpoint = $NEXT_PUBLIC_COGNITO_URL/oauth2/token
NEXT_PUBLIC_QUEMISTRY_DOMAIN =https://dkraju438qs82.cloudfront.net
NEXT_PUBLIC_RedirectUrl = $NEXT_PUBLIC_QUEMISTRY_DOMAIN/auth/google
NEXT_PUBLIC_QUEMISTRY_GATEWAY_URL=http://localhost:8080
NEXT_PUBLIC_QUEMISTRY_GATEWAY_URL=http://localhost:80
NEXT_PUBLIC_QUEMISTRY_AUTH_URL = $NEXT_PUBLIC_QUEMISTRY_GATEWAY_URL/v1/auth
2 changes: 0 additions & 2 deletions app/(full-page)/auth/google/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useCookies} from 'react-cookie'
import { redirect } from 'next/navigation'
import { GoogleSigninService } from '@/service/GoogleSignInService'
import { useContext , useEffect, useState } from 'react'
import { IS_LOGIN } from '../../../../lib/constants'
import { LayoutContext } from '../../../../layout/context/layoutcontext';
import { classNames } from 'primereact/utils';
import { Button } from 'primereact/button';
Expand Down Expand Up @@ -45,7 +44,6 @@ const GoogleAuthPage = () => {
//clear cookies
removeCookie('state');
removeCookie('code_verifier');
localStorage.setItem(IS_LOGIN, "true" );
setIsLogin(true);
})
.catch((err) => {
Expand Down
14 changes: 0 additions & 14 deletions app/(full-page)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import { Divider } from 'primereact/divider';
import { LayoutContext } from '../../layout/context/layoutcontext';
import { NodeRef } from '@/types';
import { classNames } from 'primereact/utils';
import { Dialog } from 'primereact/dialog';

const LandingPage = () => {
const [isHidden, setIsHidden] = useState(false);
const { layoutConfig } = useContext(LayoutContext);
const [showSignIn, setShowSignIn] = useState(false);

const menuRef = useRef<HTMLElement | null>(null);

Expand Down Expand Up @@ -48,18 +46,6 @@ const LandingPage = () => {
<Ripple />
</a>
</li>
<li>
<a href="#highlights" onClick={toggleMenuItemClick} className="p-ripple flex m-0 md:ml-5 px-0 py-3 text-900 font-medium line-height-3">
<span>Highlights</span>
<Ripple />
</a>
</li>
<li>
<a href="#pricing" onClick={toggleMenuItemClick} className="p-ripple flex m-0 md:ml-5 px-0 py-3 text-900 font-medium line-height-3">
<span>Pricing</span>
<Ripple />
</a>
</li>
</ul>
<div className="flex justify-content-between lg:block border-top-1 lg:border-top-none surface-border py-3 lg:py-0 mt-3 lg:mt-0">
<Link href="/auth/google" ><Button label="Sign in" text rounded className="border-none font-light line-height-2 text-blue-500"></Button></Link>
Expand Down
234 changes: 4 additions & 230 deletions app/(main)/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,261 +130,35 @@ const Dashboard = () => {
<div className="card mb-0">
<div className="flex justify-content-between mb-3">
<div>
<span className="block text-500 font-medium mb-3">Orders</span>
<span className="block text-500 font-medium mb-3">Questions Attempted</span>
<div className="text-900 font-medium text-xl">152</div>
</div>
<div className="flex align-items-center justify-content-center bg-blue-100 border-round" style={{ width: '2.5rem', height: '2.5rem' }}>
<i className="pi pi-shopping-cart text-blue-500 text-xl" />
</div>
</div>
<span className="text-green-500 font-medium">24 new </span>
<span className="text-500">since last visit</span>
</div>
</div>
<div className="col-12 lg:col-6 xl:col-3">
<div className="card mb-0">
<div className="flex justify-content-between mb-3">
<div>
<span className="block text-500 font-medium mb-3">Revenue</span>
<div className="text-900 font-medium text-xl">$2.100</div>
</div>
<div className="flex align-items-center justify-content-center bg-orange-100 border-round" style={{ width: '2.5rem', height: '2.5rem' }}>
<i className="pi pi-map-marker text-orange-500 text-xl" />
</div>
</div>
<span className="text-green-500 font-medium">%52+ </span>
<span className="text-500">since last week</span>
</div>
</div>
<div className="col-12 lg:col-6 xl:col-3">
<div className="card mb-0">
<div className="flex justify-content-between mb-3">
<div>
<span className="block text-500 font-medium mb-3">Customers</span>
<div className="text-900 font-medium text-xl">28441</div>
</div>
<div className="flex align-items-center justify-content-center bg-cyan-100 border-round" style={{ width: '2.5rem', height: '2.5rem' }}>
<i className="pi pi-inbox text-cyan-500 text-xl" />
</div>
</div>
<span className="text-green-500 font-medium">520 </span>
<span className="text-500">newly registered</span>
</div>
</div>
<div className="col-12 lg:col-6 xl:col-3">
<div className="card mb-0">
<div className="flex justify-content-between mb-3">
<div>
<span className="block text-500 font-medium mb-3">Comments</span>
<div className="text-900 font-medium text-xl">152 Unread</div>
<div className="text-900 font-medium text-xl">5 Unread</div>
</div>
<div className="flex align-items-center justify-content-center bg-purple-100 border-round" style={{ width: '2.5rem', height: '2.5rem' }}>
<i className="pi pi-comment text-purple-500 text-xl" />
</div>
</div>
<span className="text-green-500 font-medium">85 </span>
<span className="text-green-500 font-medium">10 </span>
<span className="text-500">responded</span>
</div>
</div>

<div className="col-12 xl:col-6">
<div className="card">
<h5>Recent Sales</h5>
<DataTable value={products} rows={5} paginator responsiveLayout="scroll">
<Column header="Image" body={(data) => <img className="shadow-2" src={`/demo/images/product/${data.image}`} alt={data.image} width="50" />} />
<Column field="name" header="Name" sortable style={{ width: '35%' }} />
<Column field="price" header="Price" sortable style={{ width: '35%' }} body={(data) => formatCurrency(data.price)} />
<Column
header="View"
style={{ width: '15%' }}
body={() => (
<>
<Button icon="pi pi-search" text />
</>
)}
/>
</DataTable>
</div>
<div className="card">
<div className="flex justify-content-between align-items-center mb-5">
<h5>Best Selling Products</h5>
<div>
<Button type="button" icon="pi pi-ellipsis-v" rounded text className="p-button-plain" onClick={(event) => menu1.current?.toggle(event)} />
<Menu
ref={menu1}
popup
model={[
{ label: 'Add New', icon: 'pi pi-fw pi-plus' },
{ label: 'Remove', icon: 'pi pi-fw pi-minus' }
]}
/>
</div>
</div>
<ul className="list-none p-0 m-0">
<li className="flex flex-column md:flex-row md:align-items-center md:justify-content-between mb-4">
<div>
<span className="text-900 font-medium mr-2 mb-1 md:mb-0">Space T-Shirt</span>
<div className="mt-1 text-600">Clothing</div>
</div>
<div className="mt-2 md:mt-0 flex align-items-center">
<div className="surface-300 border-round overflow-hidden w-10rem lg:w-6rem" style={{ height: '8px' }}>
<div className="bg-orange-500 h-full" style={{ width: '50%' }} />
</div>
<span className="text-orange-500 ml-3 font-medium">%50</span>
</div>
</li>
<li className="flex flex-column md:flex-row md:align-items-center md:justify-content-between mb-4">
<div>
<span className="text-900 font-medium mr-2 mb-1 md:mb-0">Portal Sticker</span>
<div className="mt-1 text-600">Accessories</div>
</div>
<div className="mt-2 md:mt-0 ml-0 md:ml-8 flex align-items-center">
<div className="surface-300 border-round overflow-hidden w-10rem lg:w-6rem" style={{ height: '8px' }}>
<div className="bg-cyan-500 h-full" style={{ width: '16%' }} />
</div>
<span className="text-cyan-500 ml-3 font-medium">%16</span>
</div>
</li>
<li className="flex flex-column md:flex-row md:align-items-center md:justify-content-between mb-4">
<div>
<span className="text-900 font-medium mr-2 mb-1 md:mb-0">Supernova Sticker</span>
<div className="mt-1 text-600">Accessories</div>
</div>
<div className="mt-2 md:mt-0 ml-0 md:ml-8 flex align-items-center">
<div className="surface-300 border-round overflow-hidden w-10rem lg:w-6rem" style={{ height: '8px' }}>
<div className="bg-pink-500 h-full" style={{ width: '67%' }} />
</div>
<span className="text-pink-500 ml-3 font-medium">%67</span>
</div>
</li>
<li className="flex flex-column md:flex-row md:align-items-center md:justify-content-between mb-4">
<div>
<span className="text-900 font-medium mr-2 mb-1 md:mb-0">Wonders Notebook</span>
<div className="mt-1 text-600">Office</div>
</div>
<div className="mt-2 md:mt-0 ml-0 md:ml-8 flex align-items-center">
<div className="surface-300 border-round overflow-hidden w-10rem lg:w-6rem" style={{ height: '8px' }}>
<div className="bg-green-500 h-full" style={{ width: '35%' }} />
</div>
<span className="text-green-500 ml-3 font-medium">%35</span>
</div>
</li>
<li className="flex flex-column md:flex-row md:align-items-center md:justify-content-between mb-4">
<div>
<span className="text-900 font-medium mr-2 mb-1 md:mb-0">Mat Black Case</span>
<div className="mt-1 text-600">Accessories</div>
</div>
<div className="mt-2 md:mt-0 ml-0 md:ml-8 flex align-items-center">
<div className="surface-300 border-round overflow-hidden w-10rem lg:w-6rem" style={{ height: '8px' }}>
<div className="bg-purple-500 h-full" style={{ width: '75%' }} />
</div>
<span className="text-purple-500 ml-3 font-medium">%75</span>
</div>
</li>
<li className="flex flex-column md:flex-row md:align-items-center md:justify-content-between mb-4">
<div>
<span className="text-900 font-medium mr-2 mb-1 md:mb-0">Robots T-Shirt</span>
<div className="mt-1 text-600">Clothing</div>
</div>
<div className="mt-2 md:mt-0 ml-0 md:ml-8 flex align-items-center">
<div className="surface-300 border-round overflow-hidden w-10rem lg:w-6rem" style={{ height: '8px' }}>
<div className="bg-teal-500 h-full" style={{ width: '40%' }} />
</div>
<span className="text-teal-500 ml-3 font-medium">%40</span>
</div>
</li>
</ul>
</div>
</div>

<div className="col-12 xl:col-6">
<div className="card">
<h5>Sales Overview</h5>
<h5>Progress</h5>
<Chart type="line" data={lineData} options={lineOptions} />
</div>

<div className="card">
<div className="flex align-items-center justify-content-between mb-4">
<h5>Notifications</h5>
<div>
<Button type="button" icon="pi pi-ellipsis-v" rounded text className="p-button-plain" onClick={(event) => menu2.current?.toggle(event)} />
<Menu
ref={menu2}
popup
model={[
{ label: 'Add New', icon: 'pi pi-fw pi-plus' },
{ label: 'Remove', icon: 'pi pi-fw pi-minus' }
]}
/>
</div>
</div>

<span className="block text-600 font-medium mb-3">TODAY</span>
<ul className="p-0 mx-0 mt-0 mb-4 list-none">
<li className="flex align-items-center py-2 border-bottom-1 surface-border">
<div className="w-3rem h-3rem flex align-items-center justify-content-center bg-blue-100 border-circle mr-3 flex-shrink-0">
<i className="pi pi-dollar text-xl text-blue-500" />
</div>
<span className="text-900 line-height-3">
Richard Jones
<span className="text-700">
{' '}
has purchased a blue t-shirt for <span className="text-blue-500">79$</span>
</span>
</span>
</li>
<li className="flex align-items-center py-2">
<div className="w-3rem h-3rem flex align-items-center justify-content-center bg-orange-100 border-circle mr-3 flex-shrink-0">
<i className="pi pi-download text-xl text-orange-500" />
</div>
<span className="text-700 line-height-3">
Your request for withdrawal of <span className="text-blue-500 font-medium">2500$</span> has been initiated.
</span>
</li>
</ul>

<span className="block text-600 font-medium mb-3">YESTERDAY</span>
<ul className="p-0 m-0 list-none">
<li className="flex align-items-center py-2 border-bottom-1 surface-border">
<div className="w-3rem h-3rem flex align-items-center justify-content-center bg-blue-100 border-circle mr-3 flex-shrink-0">
<i className="pi pi-dollar text-xl text-blue-500" />
</div>
<span className="text-900 line-height-3">
Keyser Wick
<span className="text-700">
{' '}
has purchased a black jacket for <span className="text-blue-500">59$</span>
</span>
</span>
</li>
<li className="flex align-items-center py-2 border-bottom-1 surface-border">
<div className="w-3rem h-3rem flex align-items-center justify-content-center bg-pink-100 border-circle mr-3 flex-shrink-0">
<i className="pi pi-question text-xl text-pink-500" />
</div>
<span className="text-900 line-height-3">
Jane Davis
<span className="text-700"> has posted a new questions about your product.</span>
</span>
</li>
</ul>
</div>
<div
className="px-4 py-5 shadow-2 flex flex-column md:flex-row md:align-items-center justify-content-between mb-3"
style={{
borderRadius: '1rem',
background: 'linear-gradient(0deg, rgba(0, 123, 255, 0.5), rgba(0, 123, 255, 0.5)), linear-gradient(92.54deg, #1C80CF 47.88%, #FFFFFF 100.01%)'
}}
>
<div>
<div className="text-blue-100 font-medium text-xl mt-2 mb-3">TAKE THE NEXT STEP</div>
<div className="text-white font-medium text-5xl">Try PrimeBlocks</div>
</div>
<div className="mt-4 mr-auto md:mt-0 md:mr-0">
<Link href="https://blocks.primereact.org" className="p-button font-bold px-5 py-3 p-button-warning p-button-rounded p-button-raised">
Get Started
</Link>
</div>
</div>
</div>
</div>
);
Expand Down
Loading

0 comments on commit 273510e

Please sign in to comment.