generated from UofA-Blueprint/ScaffoldTool
-
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.
Merge pull request #27 from UofA-Blueprint/ASC-76-member-profile-picture
✨ profile picture component
- Loading branch information
Showing
5 changed files
with
127 additions
and
11 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
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
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,69 @@ | ||
import { ReactNode, useState, useCallback } from "react"; | ||
import IconOption from "./IconOption"; | ||
import ColorPicker from "./ColorPicker"; | ||
import { | ||
PawPrint, | ||
Tree, | ||
Camera, | ||
Pizza, | ||
Atom, | ||
Binoculars, | ||
SoccerBall, | ||
Coffee, | ||
} from "@phosphor-icons/react"; | ||
import clsx from "clsx"; | ||
import ProfileColor from "@/types/ProfileColor"; | ||
|
||
const MemberProfilePicture = () => { | ||
const body = "flex flex-col w-full gap-2"; | ||
|
||
const controls = "flex flex-row items-start justify-between w-full"; | ||
|
||
const icons = | ||
"flex flex-row items-start justify-start flex-wrap gap-4 w-full"; | ||
|
||
const header = "text-h4"; | ||
|
||
const [backgroundColor, setBackgroundColor] = | ||
useState<ProfileColor>("bg-profile-water"); | ||
|
||
const [selectedIcon, setSelectedIcon] = useState<string | null>(null); | ||
|
||
const iconMap: Record<string, ReactNode> = { | ||
PawPrint: <PawPrint size={32} />, | ||
Tree: <Tree size={32} />, | ||
Camera: <Camera size={32} />, | ||
Pizza: <Pizza size={32} />, | ||
Atom: <Atom size={32} />, | ||
Binoculars: <Binoculars size={32} />, | ||
SoccerBall: <SoccerBall size={32} />, | ||
Coffee: <Coffee size={32} />, | ||
}; | ||
|
||
const iconList = Object.keys(iconMap); | ||
|
||
return ( | ||
<div className={clsx(body)}> | ||
<div className={clsx(controls)}> | ||
<h2 className={clsx(header)}>Member Profile Picture</h2> | ||
<ColorPicker | ||
backgroundColor={backgroundColor} | ||
setBackgroundColor={setBackgroundColor} | ||
/> | ||
</div> | ||
<div className={clsx(icons)}> | ||
{iconList.map((iconName) => ( | ||
<IconOption | ||
key={iconName} | ||
icon={iconMap[iconName]} | ||
color={backgroundColor} | ||
selected={selectedIcon === iconName} | ||
setSelectedIcon={() => setSelectedIcon(iconName)} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MemberProfilePicture; |
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,20 @@ | ||
import React from "react"; | ||
import MemberProfilePicture from "@/components/MemberProfilePicture"; | ||
import { Pencil } from "@phosphor-icons/react"; | ||
import Modal from "@/components/Modal"; | ||
|
||
const MemberProfilePictureTest = () => { | ||
return ( | ||
<div className="fixed inset-0 flex flex-col gap-6 items-center justify-center bg-gray-900"> | ||
<Modal | ||
isOpen={true} | ||
onClose={() => {}} | ||
title="Edit Member Modal" | ||
icon={<Pencil size={32} />} | ||
content={<MemberProfilePicture />} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MemberProfilePictureTest; |