Skip to content

Commit

Permalink
update(ui update): make the necessary changes on the ui from the sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
daluclemas committed Jun 14, 2024
1 parent 8507411 commit 0d6eff6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
15 changes: 14 additions & 1 deletion src/components/contact-us/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useRef } from "react";
import { useForm } from "react-hook-form";
import { yupResolver } from "@hookform/resolvers/yup";
import * as yup from "yup";
Expand Down Expand Up @@ -40,6 +40,16 @@ const ContactUsComponent = () => {
},
});
const onsubmit = (data) => handleContactUs(data);

const textareaRef = useRef();

const handleTextAreaFocus = () => {
textareaRef.current.classList.add("border-[rgb(233,152,203)]");
};

const handleTextAreaBlur = () => {
textareaRef.current.classList.remove("border-[rgb(233,152,203)]");
};
return (
<>
<section className=" text-sealBrown font-mulish w-full -mt-8 bg-whiteSmoke">
Expand Down Expand Up @@ -105,12 +115,15 @@ const ContactUsComponent = () => {
className={`w-full md:max-w-[549px] h-[290px] mt-2 rounded-md border border-gains overflow-hidden ${
errors.description?.message && "border-primaryPink"
}`}
ref={textareaRef}
>
<textarea
{...register("description")}
name="description"
placeholder="Write your message"
className="text-base w-full h-full border-0 outline-none p-3 bg-white placeholder:text-[rgba(130,130,130,1)] resize-none"
onFocus={handleTextAreaFocus}
onBlur={handleTextAreaBlur}
></textarea>
</div>
<p className="text-primaryPink text-sm">
Expand Down
18 changes: 16 additions & 2 deletions src/components/inputs/PrimaryInput.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useRef } from "react";

const PrimaryInput = ({
label,
Expand All @@ -9,11 +9,20 @@ const PrimaryInput = ({
errors,
isRequired = true,
}) => {
const inputRef = useRef();

const handleInputFocus = () => {
inputRef.current.classList.add("border-[rgb(233,152,203)]");
};

const handleInputBlur = () => {
inputRef.current.classList.remove("border-[rgb(233,152,203)]");
};
return (
<div className="w-full md:max-w-[455px] mb-6">
<label
htmlFor={name}
className="text-base capitalize font-medium text-[rgba(46,52,79,1)]"
className="text-base capitalize font-medium text-[rgba(46,52,79,1)] "
>
{label}
</label>
Expand All @@ -22,19 +31,24 @@ const PrimaryInput = ({
className={`w-full rounded-md border border-gains h-[50px] overflow-hidden mt-2 ${
errors && "border-primaryPink"
}`}
ref={inputRef}
>
{isRequired ? (
<input
type={type}
placeholder={placeholder}
{...register(name)}
className="text-base w-full h-full border-0 outline-none px-3 bg-white placeholder:text-[rgba(130,130,130,1)]"
onFocus={handleInputFocus}
onBlur={handleInputBlur}
/>
) : (
<input
type={type}
placeholder={placeholder}
className="text-base w-full h-full border-0 outline-none px-3 bg-white placeholder:text-[rgba(130,130,130,1)]"
onFocus={handleInputFocus}
onBlur={handleInputBlur}
/>
)}
</div>
Expand Down
1 change: 0 additions & 1 deletion src/pages/home/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const HomePage = () => {
<p className="text-lg md:text-2xl my-3 font-semibold">
{activity.title}
</p>
<p>{activity.description}</p>
</div>
</div>
))}
Expand Down
9 changes: 3 additions & 6 deletions src/utils/appData.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,27 +243,24 @@ export const clubActivities = [

export const activities = [
{
title: "Coding workshops",
title: "Coding",
image: codingHeroImage,
description: "Coding workshops",
},
{
title: "Game Development",
image: gameDevHeroImage,
description: "Coding workshops",
},
{
title: "Robotics (Arduino, Raspberry Pi)",
image: roboticsHeroImage,
description: "Coding workshops",
},
];

export const faqs = [
{
title: "What is the SheCodeAfrica STEM-A-GIRL program about?",
title: "What is the SheCodeAfrica STEM-A-GIRL Program about?",
content:
"The She Code Africa STEM Club is an initiative aimed at empowering girls to pursue careers in Science, Technology, Engineering, and Math (STEM).",
"The She Code Africa STEM-A-Girl Program is an initiative aimed at empowering girls to pursue careers in Science, Technology, Engineering, and Math (STEM).",
},
{
title: "Who can join the STEM Club?",
Expand Down

0 comments on commit 0d6eff6

Please sign in to comment.