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

Fixing broken Storybook component #96

Merged
merged 36 commits into from
Nov 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f02d598
updates
vselvarajijay Nov 5, 2023
d83e620
Merge branch 'akello-io:main' into main
vselvarajijay Nov 5, 2023
ae76b11
check-point - major UI refactor
vselvarajijay Nov 5, 2023
e3ac5d7
updates
vselvarajijay Nov 5, 2023
f9c1f0d
udpates to react component library
vselvarajijay Nov 5, 2023
6db1e2d
Merge branch 'akello-io:main' into main
vselvarajijay Nov 5, 2023
f4f995e
publishing npm updates
vselvarajijay Nov 5, 2023
bd2a287
adding FHIR types
vselvarajijay Nov 5, 2023
899e5d1
Setting up new App
vselvarajijay Nov 5, 2023
ab9377e
More additions to new app
vselvarajijay Nov 5, 2023
48a2bcb
Updates to app
vselvarajijay Nov 5, 2023
280090b
merge
vselvarajijay Nov 5, 2023
42ff175
clearing out env
vselvarajijay Nov 5, 2023
3141e46
removing pages from react component library
vselvarajijay Nov 6, 2023
b457bc2
working version of core...
vselvarajijay Nov 6, 2023
54e27da
working core with API
vselvarajijay Nov 6, 2023
43626b5
init AkelloAPIService
vselvarajijay Nov 6, 2023
259afe4
Working PoC with external npm packages
vselvarajijay Nov 6, 2023
2f64922
checking in updates
vselvarajijay Nov 6, 2023
92c48b3
bulk updates - rebuild app-ui with component library
vselvarajijay Nov 7, 2023
4f7b88f
getting login/logout working..
vselvarajijay Nov 7, 2023
1eec08a
safe state
vselvarajijay Nov 7, 2023
3a5335a
saving state - refactoring
vselvarajijay Nov 7, 2023
cc566b9
auth updates
vselvarajijay Nov 7, 2023
32536f7
cleaning up
vselvarajijay Nov 7, 2023
42a1572
holding state
vselvarajijay Nov 7, 2023
03c2dae
update
vselvarajijay Nov 7, 2023
ea4d8e7
updates
vselvarajijay Nov 7, 2023
59634bc
updates
vselvarajijay Nov 7, 2023
5740e88
updates
vselvarajijay Nov 7, 2023
a625531
updates
vselvarajijay Nov 7, 2023
2eae6e7
updates
vselvarajijay Nov 8, 2023
a89b53b
saving states
vselvarajijay Nov 8, 2023
cb6ff15
merge upstream fork
vselvarajijay Nov 8, 2023
b1119a1
fixing component
vselvarajijay Nov 8, 2023
228e035
Merge remote-tracking branch 'upstream/main'
vselvarajijay Nov 8, 2023
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
Prev Previous commit
Next Next commit
updates
vselvarajijay committed Nov 8, 2023
commit 2eae6e703a7bd78960ed67950f2c614af806685e
2 changes: 2 additions & 0 deletions packages/apps/akello-app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ import Login from "./pages/Login";
import {Provider, useSelector} from "react-redux";
import {RootState, store} from "./store";
import DashboardPage from "./pages/DashboardPage";
import RegistryPage from "./pages/RegistryPage";


Amplify.configure({
@@ -30,6 +31,7 @@ function App() {
<Route index element={<HomePage />}/>
<Route path={"/login"} element={<Login />} />
<Route path={'/dashboard'} element={<DashboardPage />} />
<Route path={'/registry'} element={<RegistryPage />} />
</Routes>
</BrowserRouter>
</Provider>
4 changes: 2 additions & 2 deletions packages/apps/akello-app/src/containers/PageContainer.tsx
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import {useEffect, useState} from "react";
import * as React from "react";
import {SideNavigation} from '@akello/react'
import AkelloLogo from '../images/logos/akello/akello-corner-logo.svg'
import top_nav_buttons from "../side_nav_buttons";
import {top_nav_buttons, bottom_nav_buttons } from "../side_nav_buttons";


interface PageContainerProps {
@@ -28,7 +28,7 @@ const PageContainer:React.FC<PageContainerProps> = ({children}) => {
<SideNavigation
logo={AkelloLogo}
top_navigation={top_nav_buttons}
bottom_navigation={top_nav_buttons}
bottom_navigation={bottom_nav_buttons}
/>
<div className={'pl-20'}>
{children}
Original file line number Diff line number Diff line change
@@ -7,9 +7,6 @@ import {Auth} from "aws-amplify";
import GithubLogo from "../images/logos/github-logo-vector.svg";
import { TopNavigation, ThemeSwap } from '@akello/react'
import * as React from "react";
import {SideNavigation} from '@akello/react'
import AkelloLogo from '../images/logos/akello/akello-corner-logo.svg'
import top_nav_buttons from "../side_nav_buttons";


interface PublicPageContainerProps {
2 changes: 0 additions & 2 deletions packages/apps/akello-app/src/pages/DashboardPage.tsx
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@ import {Auth} from "aws-amplify";

const DashboardPage = () => {


return (
<>
<PageContainer>
@@ -19,7 +18,6 @@ const DashboardPage = () => {
});
}}>sign out</button>
</PageContainer>

</>
)
}
7 changes: 4 additions & 3 deletions packages/apps/akello-app/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import PageContainer from "../containers/PageContainer";
import React, {useState} from "react";
import {useDispatch, useSelector} from "react-redux";
import LandingPage from "./LandingPage";
import RegistrySelectionPage from './RegistrySelectionPage';
import {Auth} from "aws-amplify";
import {CognitoUserSession} from "amazon-cognito-identity-js";
import {setAuthToken} from "../reducers/appSlice";
@@ -28,9 +29,9 @@ const HomePage:React.FC<HomePageProps> = () => {
return (
<>
{loggedIn && (
<PageContainer>
<RegistryPage />
</PageContainer>
<PublicPageContainer>
<RegistrySelectionPage />
</PublicPageContainer>

)}
{!loggedIn && (
16 changes: 15 additions & 1 deletion packages/apps/akello-app/src/pages/RegistryPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
import {Auth} from "aws-amplify";
import PageContainer from "../containers/PageContainer";

const RegistryPage = () => {
return (
<>
Registry Page
<PageContainer>
Registry Page

<button className={"btn btn-primary btn-xl"} onClick={() => {
Auth.signOut()
.then(() => {
window.location.reload();
})
.catch(err => {
debugger;
});
}}>sign out</button>
</PageContainer>
</>
)
}
37 changes: 37 additions & 0 deletions packages/apps/akello-app/src/pages/RegistrySelectionPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {WelcomeTemplate, RegistryMemberships, RegistrySelectRow} from '@akello/react'
import AkelloLogo from '../../src/images/logos/akello/akello-corner-logo.svg'


const RegistrySelectionPage = () => {

return (
<div className={'w-screen h-auto bg-base-200/40'}>
<WelcomeTemplate first_name={'Vijay'}>

<RegistryMemberships>

<RegistrySelectRow
logo={AkelloLogo}
name={'Registry A'}
members={5}
patients={5}
onClick={() => {}}
/>

<RegistrySelectRow
logo={AkelloLogo}
name={'Registry B'}
members={5}
patients={5}
onClick={() => {}}
/>


</RegistryMemberships>

</WelcomeTemplate>
</div>
)
}

export default RegistrySelectionPage
84 changes: 76 additions & 8 deletions packages/apps/akello-app/src/side_nav_buttons.tsx
Original file line number Diff line number Diff line change
@@ -8,27 +8,95 @@ import {
ChatBubbleLeftRightIcon,
HeartIcon,
TableCellsIcon,
UserGroupIcon
UserGroupIcon,
Cog8ToothIcon
} from '@heroicons/react/24/outline'


const icon_size = 'w-6 h-auto'


const DashboardButton = () => {
const location = useLocation();
const navigate = useNavigate()
return (
<SideNavigationButton
name={'btn'}
short_name={'button'}
name={'Dashboard'}
short_name={'Dashboard'}
is_active={location.pathname.includes('dashboard')}
icon={<TableCellsIcon className={'w-5 h-auto'}/>}
icon={<ChartBarSquareIcon className={icon_size}/>}
navigate={() => navigate('/dashboard')}
/>
)
}

const top_nav_buttons = [
(<DashboardButton />)
]

const RegistryButton = () => {
const location = useLocation();
const navigate = useNavigate()
return (
<SideNavigationButton
name={'Registry'}
short_name={'Registry'}
is_active={location.pathname.includes('registry')}
icon={<TableCellsIcon className={icon_size}/>}
navigate={() => navigate('/registry')}
/>
)
}


const TeamButton = () => {
const location = useLocation();
const navigate = useNavigate()
return (
<SideNavigationButton
name={'Team'}
short_name={'Team'}
is_active={location.pathname.includes('team')}
icon={<UserGroupIcon className={icon_size}/>}
navigate={() => navigate('/team')}
/>
)
}

const ReportsButton = () => {
const location = useLocation();
const navigate = useNavigate()
return (
<SideNavigationButton
name={'Reports'}
short_name={'Reports'}
is_active={location.pathname.includes('reports')}
icon={<ChartBarSquareIcon className={icon_size}/>}
navigate={() => navigate('/reports')}
/>
)
}


const SettingsButton = () => {
const location = useLocation();
const navigate = useNavigate()
return (
<SideNavigationButton
name={'Settings'}
short_name={'Settings'}
is_active={location.pathname.includes('settings')}
icon={<Cog8ToothIcon className={icon_size}/>}
navigate={() => navigate('/settings')}
/>
)
}


export const top_nav_buttons = [
(<DashboardButton />),
(<RegistryButton />),
(<TeamButton />),
(<ReportsButton />)
]

export default top_nav_buttons
export const bottom_nav_buttons = [
(<SettingsButton />)
]
2 changes: 1 addition & 1 deletion packages/apps/akello-app/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ module.exports = {
},
extend: {
colors: {
'ak-light-blue': '#c3d7fa',
'ak-light-blue': '#3081FA',
'crx-red': '#FF755F',
'ak-dark-blue': '#001338',
'ak-yellow': '#FFEC1F'
Original file line number Diff line number Diff line change
@@ -13,15 +13,15 @@ const RegistrySelectRow = (props: RegistrySelectRowProps) => {

return (
<>
<div className={"flex flex-row w-full justify-between bg-white py-8 px-12"} onClick={() => {
<div className={"flex flex-row w-full justify-between bg-base-100 py-8 px-12"} onClick={() => {
props.onClick('registry-id')
}}>
<div className={" flex flex-row space-x-4"}>
<div>
<img src={props.logo} className={"w-28 h-auto rounded-lg cursor-pointer"}/>
</div>

<div className={"flex flex-col space-y-4"}>
<div className={"flex flex-col space-y-4 text-base-content"}>
<div className={"font-medium text-3xl"}>
{props.name}
</div>
@@ -32,7 +32,7 @@ const RegistrySelectRow = (props: RegistrySelectRowProps) => {

</div>
<div className={"my-auto"}>
<button className={"btn bg-ak-yellow rounded-lg text-xl"}>
<button className={"btn btn-warning"}>
LAUNCH
</button>
</div>