-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
2,583 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
apps/app/src/features/lms/client/components/CourceLayout/CourceLayout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React, { ReactNode } from 'react'; | ||
|
||
import dynamic from 'next/dynamic'; | ||
|
||
import { RawLayout } from '~/components/Layout/RawLayout'; | ||
import { GrowiNavbar } from '~/components/Navbar/GrowiNavbar'; | ||
import { PagePresentationModal } from '~/components/PagePresentationModal'; | ||
|
||
|
||
const SystemVersion = dynamic(() => import('~/components/SystemVersion'), { ssr: false }); | ||
const HotkeysManager = dynamic(() => import('~/components/Hotkeys/HotkeysManager'), { ssr: false }); | ||
|
||
|
||
type Props = { | ||
componentTitle?: string | ||
children?: ReactNode | ||
} | ||
|
||
|
||
export const CourceLayout = ({ | ||
children, componentTitle, | ||
}: Props): JSX.Element => { | ||
|
||
return ( | ||
<RawLayout> | ||
<div> | ||
<GrowiNavbar /> | ||
|
||
<header className="py-0 container-fluid"> | ||
<h1 className="title px-3">{componentTitle}</h1> | ||
</header> | ||
<div id="main" className="main"> | ||
<div className="container-fluid"> | ||
{children} | ||
</div> | ||
</div> | ||
|
||
<PagePresentationModal /> | ||
<SystemVersion /> | ||
</div> | ||
|
||
<HotkeysManager /> | ||
|
||
</RawLayout> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
apps/app/src/features/lms/client/components/CourceLayout/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './CourceLayout'; |
136 changes: 135 additions & 1 deletion
136
apps/app/src/features/lms/client/components/CourceView/CourceDashboard/CourceDashboard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,137 @@ | ||
import { useEffect, useState } from 'react'; | ||
|
||
import { TinyLine, Liquid, Column } from '@ant-design/plots'; | ||
|
||
const DemoTinyLine = () => { | ||
const data: number[] = []; | ||
for (let i = 0; i < 10; i++) { | ||
data.push(Math.random() * 1000); | ||
} | ||
const config = { | ||
height: 60, | ||
autoFit: false, | ||
data, | ||
smooth: true, | ||
}; | ||
return <TinyLine {...config} />; | ||
}; | ||
|
||
const DemoLiquid = () => { | ||
const config = { | ||
percent: 0.25, | ||
outline: { | ||
border: 4, | ||
distance: 8, | ||
}, | ||
wave: { | ||
length: 128, | ||
}, | ||
}; | ||
return <Liquid {...config} />; | ||
}; | ||
|
||
const DemoColumn = () => { | ||
const [data, setData] = useState([]); | ||
|
||
const asyncFetch = () => { | ||
fetch('https://gw.alipayobjects.com/os/antfincdn/8elHX%26irfq/stack-column-data.json') | ||
.then(response => response.json()) | ||
.then(json => setData(json)) | ||
.catch((error) => { | ||
console.log('fetch data failed', error); | ||
}); | ||
}; | ||
const config = { | ||
data, | ||
isStack: true, | ||
xField: 'year', | ||
yField: 'value', | ||
seriesField: 'type', | ||
}; | ||
|
||
useEffect(() => { | ||
asyncFetch(); | ||
}, []); | ||
|
||
return <Column {...config} />; | ||
}; | ||
|
||
export const CourceDashboard = (): JSX.Element => { | ||
return <>(TBD) Dashboard</>; | ||
return ( | ||
<> | ||
<div className="row"> | ||
<div className="col-4"> | ||
<div className="card mb-3"> | ||
<div className="row no-gutters"> | ||
<div className="col-md-4 d-flex flex-column align-items-center justify-content-center bg-light"> | ||
<div><b>Active user / week</b></div> | ||
<div className="display-3">26</div> | ||
</div> | ||
<div className="col-md-8"> | ||
<div className="card-body"> | ||
<h5 className="card-title">Card title</h5> | ||
<p className="card-text"><DemoTinyLine /></p> | ||
<p className="card-text text-right"><small className="text-muted">Last updated 3 mins ago</small></p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="col-4"> | ||
<div className="card mb-3"> | ||
<div className="row no-gutters"> | ||
<div className="col-md-4 d-flex flex-column align-items-center justify-content-center bg-light"> | ||
<div><b>Active user / month</b></div> | ||
<div className="display-3">500</div> | ||
</div> | ||
<div className="col-md-8"> | ||
<div className="card-body"> | ||
<h5 className="card-title">Card title</h5> | ||
<p className="card-text"><DemoTinyLine /></p> | ||
<p className="card-text text-right"><small className="text-muted">Last updated 3 mins ago</small></p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="col-4"> | ||
<div className="card mb-3"> | ||
<div className="row no-gutters"> | ||
<div className="col-md-4 d-flex flex-column align-items-center justify-content-center bg-light"> | ||
<div><b>Active organizations</b></div> | ||
<div className="display-3">1349</div> | ||
</div> | ||
<div className="col-md-8"> | ||
<div className="card-body"> | ||
<h5 className="card-title">Card title</h5> | ||
<p className="card-text"><DemoTinyLine /></p> | ||
<p className="card-text text-right"><small className="text-muted">Last updated 3 mins ago</small></p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="row"> | ||
<div className="col-4"> | ||
<div className="card mb-3"> | ||
<div className="card-body"> | ||
<h5 className="card-title">Completed users</h5> | ||
<p className="d-flex justify-content-center" style={{ minHeight: '300px' }}><DemoLiquid /></p> | ||
<p className="card-text text-right"><small className="text-muted">Last updated 3 mins ago</small></p> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="col-8"> | ||
<div className="card mb-3"> | ||
<div className="card-body"> | ||
<h5 className="card-title">Completed users</h5> | ||
<p className="d-flex justify-content-center" style={{ minHeight: '300px' }}><DemoColumn /></p> | ||
<p className="card-text text-right"><small className="text-muted">Last updated 3 mins ago</small></p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.