generated from UofA-Blueprint/ScaffoldTool
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Asc 63 #15
Merged
Asc 63 #15
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f9238ac
First draft
ShanemelAsuncion a94a94a
Merge branch 'main' into ASC-63
ShanemelAsuncion 10c47c0
update
ShanemelAsuncion 40e69eb
merge main to ASC 63
khanheric2003 6d12a7d
fixed ProfilePicture doing MemberHeader -- still bug
khanheric2003 ab5eaea
Finish InputField
ShanemelAsuncion 4d54bb7
Merge branch 'main' into ASC-63
ShanemelAsuncion 2566c7e
Update from main
ShanemelAsuncion ae629e9
Fix merge conflict
ShanemelAsuncion be606da
changes the arrangement
khanheric2003 83bbccb
merge main
khanheric2003 3780fbc
merge2
khanheric2003 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { WarningCircle } from "@phosphor-icons/react"; | ||
import { useRef, useState } from "react"; | ||
|
||
|
||
export interface InputFieldProps { | ||
type: string; | ||
error: boolean; | ||
label?: string; // Optional; Default to none. | ||
required: boolean; | ||
} | ||
|
||
function InputField({ type, error, label, required }: InputFieldProps) { | ||
// todo: functionality | ||
const inputRef = useRef<HTMLInputElement>(null); | ||
|
||
function checkLen(event: { preventDefault: () => void; }){ | ||
event.preventDefault(); | ||
if(inputRef.current){ | ||
if (inputRef.current.value.trim() === "" && required === true) { | ||
console.log("Required Input is empty");} | ||
} | ||
} | ||
|
||
return <div className="mt-5 w-[30em]"> | ||
{required === false | ||
? <label className="font-extrabold block mb-1 ml-1 text-sm text-light-500 dark:text-white"> | ||
{label} | ||
</label> | ||
: | ||
<label className="font-extrabold block mb-1 ml-1 text-sm text-light-500 dark:text-white" > | ||
{label} <span className="text-red-500"> * </span> | ||
</label> | ||
} | ||
|
||
{error !== true | ||
? <input placeholder={"Enter "+ type +"..."} type={type} ref={inputRef} onSelect={checkLen} | ||
className="bg-gray-50 border border-gray-300 text-light-500 text-sm rounded-lg focus:outline-none focus:drop-shadow-[0_0px_5px_rgba(0,0,0,0.25)] hover:outline-none hover:drop-shadow-[0_0px_5px_rgba(0,0,0,0.25)] block w-full p-2.5 dark:text-white"> | ||
</input> | ||
|
||
: <div><input placeholder={"Enter "+ type +"..."} type={type} ref={inputRef} onSelect={checkLen} | ||
className="bg-gray-50 border border-red-500 text-light-500 text-sm rounded-lg focus:outline-none focus:drop-shadow-[0_0px_5px_rgba(0,0,0,0.25)] hover:outline-none hover:drop-shadow-[0_0px_5px_rgba(0,0,0,0.25)] block w-full p-2.5 dark:text-white"> | ||
</input> | ||
|
||
<div className="flex mt-1 align-middle"> | ||
<WarningCircle color="red" className="mr-1" size={"1.1em"} /> | ||
<span className="text-red-500 text-xs "> Error {type} </span> | ||
</div> | ||
</div> | ||
} | ||
</div>; | ||
} | ||
|
||
export default InputField; |
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,41 @@ | ||
// MemberHeader.tsx | ||
import { ReactNode } from "react"; | ||
import ProfilePictures from "./ProfilePictures"; | ||
import { twMerge } from "tailwind-merge"; | ||
|
||
interface MemberHeaderProp { | ||
profilePicChildren: ReactNode; | ||
backgroundColor: | ||
| "tulip" | ||
| "gold" | ||
| "lime" | ||
| "jade" | ||
| "water" | ||
| "air" | ||
| "lilac" | ||
| "candy"; | ||
username: string; | ||
} | ||
|
||
function MemberHeader({ | ||
profilePicChildren, | ||
backgroundColor, | ||
username, | ||
}: MemberHeaderProp) { | ||
return ( | ||
<div | ||
className={twMerge("flex flex-col md:flex-row items-center w-full h-36")} | ||
> | ||
<div className="w-32 h-32"> | ||
<ProfilePictures backgroundColor={backgroundColor}> | ||
{profilePicChildren} | ||
</ProfilePictures> | ||
</div> | ||
<div className=" pl-2 font-bold justify-center flex pb-2 w-20"> | ||
<h1>{username}</h1> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default MemberHeader; |
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,34 +1,32 @@ | ||
import * as Icon from '@phosphor-icons/react' | ||
import { ReactNode } from 'react'; | ||
//define the prop types for the component | ||
interface Props { | ||
children: ReactNode; | ||
backgroundColor: 'tulip' | 'gold' | 'lime' | 'jade' | 'water' | 'air' | 'lilac' | 'candy'; | ||
} | ||
import * as Icon from "@phosphor-icons/react"; | ||
import { ReactNode } from "react"; | ||
import { twMerge } from "tailwind-merge"; | ||
|
||
interface Props { | ||
children: ReactNode; | ||
backgroundColor: | ||
| "tulip" | ||
| "gold" | ||
| "lime" | ||
| "jade" | ||
| "water" | ||
| "air" | ||
| "lilac" | ||
| "candy"; | ||
} | ||
|
||
const ProfilePictures=(props:Props)=>{ | ||
|
||
const backgroundColor= `bg-profile-${props.backgroundColor}` | ||
// return(<div> | ||
// <div className="overflow-hidden justify-center items-center rounded-full w-32 h-32"> | ||
// {props.children? | ||
// <img className="object-center w-32 h-32" src={props.children} alt="Profile Pic" /> | ||
// : | ||
// <div className={`bg-profile-${props.backgroundColor} flex justify-center items-center rounded-full w-32 h-32`}> | ||
// <Icon.PawPrint size={120} color={'white'} /> | ||
// </div> | ||
// } | ||
|
||
// </div> | ||
|
||
// </div>); | ||
const ProfilePictures = (props: Props) => { | ||
const backgroundColor = `bg-profile-${props.backgroundColor}`; | ||
const className = twMerge( | ||
backgroundColor, | ||
"object-cover object-center flex overflow-hidden justify-center items-center rounded-full w-full h-full" | ||
); | ||
|
||
return(<div> | ||
<div className={`bg-profile-${props.backgroundColor} object-fill object-center flex overflow-hidden justify-center items-center rounded-full w-32 h-32`}> | ||
{props.children} | ||
</div> | ||
</div>) | ||
return ( | ||
<div className="w-full h-full"> | ||
<div className={className}>{props.children}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ProfilePictures; | ||
export default ProfilePictures; |
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,21 @@ | ||
import Button from "@/components/Button"; | ||
import InputField from "@/components/InputField"; | ||
|
||
function InputFieldTestRoute() { | ||
return ( | ||
<div className="flex flex-col justify-center items-center min-h-screen bg-neutrals-dark-100"> | ||
{/* Required Field */} | ||
<InputField type="text" error={false} label="Input Text" required={true}/> | ||
{/* Optional field */} | ||
<InputField type="text" error={false} label="Input Text" required={false}/> | ||
{/* Error field */} | ||
<InputField type="text" error={true} label="Input Text" required={true}/> | ||
{/* No label */} | ||
<InputField type="text" error={false} required={false}/> | ||
|
||
|
||
</div> | ||
); | ||
} | ||
|
||
export default InputFieldTestRoute; |
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,64 @@ | ||
import { ReactNode } from "react"; | ||
import MemberHeader from "@/components/MemberHeader"; | ||
import ProfilePictures from "@/components/ProfilePictures"; | ||
import profilePic from "@/assets/images/face2.jpg"; | ||
import profilePic1 from "@/assets/images/face1.jpeg"; | ||
import profilePic2 from "@/assets/images/face.jpeg"; | ||
|
||
import * as Icon from "@phosphor-icons/react"; | ||
|
||
function MemberHeaderTestRoute() { | ||
return ( | ||
<div className="flex flex-col space-y-4 p-4"> | ||
<MemberHeader | ||
backgroundColor="tulip" | ||
username="User 1" | ||
profilePicChildren={ | ||
<img | ||
className=" w-32 h-32 object-cover rounded-full" | ||
src={profilePic} | ||
alt="Profile pic" | ||
/> | ||
} | ||
/> | ||
|
||
<MemberHeader | ||
backgroundColor="gold" | ||
username="User 2" | ||
profilePicChildren={ | ||
<img | ||
className=" h-32 w-32 object-cover rounded-full" | ||
src={profilePic1} | ||
alt="Profile pic" | ||
/> | ||
} | ||
/> | ||
|
||
<MemberHeader | ||
backgroundColor="lime" | ||
username="User 3" | ||
profilePicChildren={ | ||
<img | ||
className=" w-32 h-32 object-cover rounded-full" | ||
src={profilePic2} | ||
alt="Profile pic" | ||
/> | ||
} | ||
/> | ||
|
||
<MemberHeader | ||
backgroundColor="jade" | ||
username="User 4" | ||
profilePicChildren={ | ||
<img | ||
className=" h-32 w-32 object-cover rounded-full" | ||
src={profilePic} | ||
alt="Profile pic" | ||
/> | ||
} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
export default MemberHeaderTestRoute; |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text are white so wen you type you cannot see the text.