-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Home page (Before and After Login)
- Loading branch information
1 parent
df7c92e
commit 0b5ed1d
Showing
20 changed files
with
449 additions
and
62 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,7 +1,70 @@ | ||
const Home = () => { | ||
import Image from 'next/image'; | ||
import BeforeLogin from '@/components/home/BeforeLogin'; | ||
import AfterLogin from '@/components/home/AfterLogin'; | ||
import {getCurrentUser} from '@/access/AuthenticationService'; | ||
import Role from '@/access/Role'; | ||
import LoginButton from '@/components/home/LoginButton'; | ||
import {getAnnouncements, getNumberOfGroupings, getNumberOfMemberships} from '@/services/GroupingsApiService'; | ||
import Announcement from '@/components/home/Announcement'; | ||
|
||
const Home = async () => { | ||
const [currentUser, numberOfGroupings, numberOfMemberships, announcements] = await Promise.all([ | ||
getCurrentUser(), | ||
getNumberOfGroupings(), | ||
getNumberOfMemberships(), | ||
getAnnouncements() | ||
]); | ||
|
||
const activeAnnouncements = announcements.announcements | ||
.filter((announcement) => announcement.state === 'Active') | ||
.map((announcement) => announcement.message); | ||
|
||
|
||
return ( | ||
null | ||
<main> | ||
<div className="container mt-5 mb-5"> | ||
{activeAnnouncements.map((announcement: string, index: number) => ( | ||
<Announcement announcement={announcement} key={index}/> | ||
))} | ||
<div className="flex flex-row py-8 px-0.5 justify-between"> | ||
<div className="md:w-7/12 flex items-center"> | ||
<div> | ||
<h1 className="sr-only">UH Groupings</h1> | ||
<Image | ||
src="uhgroupings/uh-groupings-text.svg" | ||
alt="UH Groupings logotype" | ||
width={337.5} | ||
height={52.5} | ||
className="w-[210px] h-[32.67px] sm:w-1/2 sm:h-auto md:w-[337.5px] md:h-[52.5px]" | ||
/> | ||
|
||
<p className="text-xl mt-1"> Manage your groupings in one place, use them in many.</p> | ||
<div className="mt-4"> | ||
{!currentUser.roles.includes(Role.UH) && | ||
<LoginButton currentUser={currentUser}/>} | ||
</div> | ||
</div> | ||
</div> | ||
<div className="hidden lg:block md:w-5/12"> | ||
<Image | ||
src="/uhgroupings/uh-groupings-logo-large.svg" | ||
alt="UH Groupings" | ||
width={365.5} | ||
height={292.5} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{currentUser.roles.includes(Role.UH) ? ( | ||
<AfterLogin | ||
currentUser={currentUser} | ||
numberOfGroupings={numberOfGroupings} | ||
numberOfMemberships={numberOfMemberships}/> | ||
) : ( | ||
<BeforeLogin/> | ||
)} | ||
</main> | ||
); | ||
} | ||
|
||
export default Home; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Image from 'next/image'; | ||
|
||
const AboutInfoItem = ({src, alt, description, variant}: { | ||
src: string, | ||
alt: string, | ||
description: string, | ||
variant?: 'default'| 'home' | ||
}) => { | ||
const size = variant === 'home'? 'text-1.2': 'text-base'; | ||
return ( | ||
<div className="col-span-1"> | ||
<div className="flex justify-center"> | ||
<Image | ||
src={src} | ||
alt={alt} | ||
width={115} | ||
height={115}/> | ||
</div> | ||
<p className={`text-center font-normal ${size}`}>{description}</p> | ||
</div> | ||
); | ||
} | ||
export default AboutInfoItem; |
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,48 @@ | ||
import AboutInfoItem from '@/components/AboutInfoItem'; | ||
|
||
|
||
const UHGroupingsInfo = ( | ||
{ variant | ||
}: { | ||
variant?: 'default' | 'home'; | ||
}) => { | ||
const h1Color = variant === 'home' ? 'text-text-color' : 'text-uh-black'; | ||
const page = variant === 'home' ? 'home': 'default'; | ||
return ( | ||
<div> | ||
<div className="bg-seafoam pt-10 pb-10"> | ||
<div className="container"> | ||
<div className="grid"> | ||
<h1 className={`text-center text-2.5 font-medium ${h1Color}`}>What is a UH Grouping?</h1> | ||
<p className="text-center text-1.25 font-light">A <em>grouping</em> is a collection of members | ||
(e.g., all full-time | ||
Hilo faculty).</p> | ||
</div> | ||
<div className="grid grid-cols-1 md:grid-cols-3 gap-7 pt-3"> | ||
<AboutInfoItem | ||
variant={page} | ||
src={'/uhgroupings/cogs.svg'} | ||
alt={'Cogs icon'} | ||
description={'Create groupings, manage grouping memberships, control members\' ' + | ||
'self-service options, designate sync destinations, and more.'}/> | ||
<AboutInfoItem | ||
variant={page} | ||
src={'/uhgroupings/id-email.svg'} | ||
alt={'Email icon'} | ||
description={'Synchronize groupings email LISTSERV lists,' + | ||
' attributes for access control via CAS and LDAP, etc..'}/> | ||
<AboutInfoItem | ||
variant={page} | ||
src={'/uhgroupings/watch.svg'} | ||
alt={'Watch icon'} | ||
description={'Leverage group data from official sources,' + | ||
' which can substantially reduce the manual overhead of membership management.'}/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
|
||
} | ||
|
||
export default UHGroupingsInfo; |
Oops, something went wrong.