Skip to content

Commit bbcaf76

Browse files
committed
Merge branch 'develop' of https://github.com/atlp-rwanda/atlp-devpulse-fn into sidebar-link-review
2 parents ef824d4 + fcec185 commit bbcaf76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1244
-1195
lines changed

src/components/GoogleForm/ApplicationForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const ApplicationForm = () => {
1111

1212
return (
1313
<div>
14-
<div className='flex '>
14+
<div className='flex justify-center'>
1515
<div className='flex px-5 py-2 w-fit'>
1616
<button
1717
onClick={() =>
@@ -23,7 +23,7 @@ const ApplicationForm = () => {
2323
</button>
2424
</div>
2525
<div>
26-
<Link to={'/view-forms'}>
26+
<Link to={'/admin/view-forms'}>
2727
<button className='flex bg-primary dark:bg-[#56C870] rounded-md py-2 mt-2 px-4 text-white font-medium cursor-pointer'>
2828
<icons.AiFillBook className='mt-1 mr-1 font-bold' /> View All
2929
Forms

src/components/GoogleForm/RecentForms.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const RecentForms = () => {
132132
return (
133133
<div>
134134
<div className='pl-4 md:pl-8'>
135-
<Link to={'/create-form'}>
135+
<Link to={'/admin/create-form'}>
136136
<button className='flex bg-primary dark:bg-[#56C870] rounded-md py-2 mt-2 px-4 text-white font-medium cursor-pointer'>
137137
<icons.AiOutlinePlus className='mt-1 mr-1 font-bold' /> Create New
138138
Form

src/components/GoogleForm/SaveForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function SaveFormDetails() {
135135
});
136136

137137
return (
138-
<div className='overflow-hidden py-16 px-6 lg:px-8 lg:py-24'>
138+
<div className='overflow-hidden'>
139139
<div className='relative mx-auto max-w-xl'>
140140
<div className='text-center'>
141141
<h2 className='text-3xl font-bold tracking-tight text-primary dark:text-secondary sm:text-4xl'>

src/components/GradingBox.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function GradingBox(props: any) {
7979

8080
if (exist) {
8181

82-
const newAssess = assessment.map((element, index) => {
82+
const newAssess = assessment?.map((element, index) => {
8383
if (index === id) {
8484
return nAssessment;
8585
} else {
@@ -98,7 +98,7 @@ function GradingBox(props: any) {
9898

9999
if (exist) {
100100

101-
const newGrade = grade.map((element, index) => {
101+
const newGrade = grade?.map((element, index) => {
102102
if (index === id) {
103103
if (field === "attribute") {
104104
const grde = { attribute: value, scale: element?.scale }
@@ -230,7 +230,7 @@ function GradingBox(props: any) {
230230
return (
231231
<div>
232232
<div
233-
className={` flex justify-center mt-20 static left-0`}
233+
className={` flex justify-center static left-0`}
234234
>
235235
<div className="bg-white dark:bg-dark-bg w-full lg:w-[50%] xl:w-5/12 rounded-lg p-1 xl:p-4 lg:p-4 pb-8 mb-20">
236236
<div className="card-title w-full flex flex-wrap justify-center items-center ">
@@ -265,7 +265,7 @@ function GradingBox(props: any) {
265265
changeAssess(0, e.target.value)
266266
}}
267267
options={[{ value: "--- Choose assessment---", label: "Choose assessment" },
268-
allAssessments?.data.map((element) => ({
268+
allAssessments?.data?.map((element) => ({
269269
value: element.id, label: element.label
270270
})
271271
)]}
@@ -286,7 +286,7 @@ function GradingBox(props: any) {
286286
</div>
287287
{
288288
(newAssessment.length > 0) &&
289-
newAssessment.map((element, index) => {
289+
newAssessment?.map((element, index) => {
290290
return (
291291
<div className="input mt-4 mb-4 h-9 ">
292292
<div className="grouped-input flex items-center h-full w-full rounded-md">
@@ -301,7 +301,7 @@ function GradingBox(props: any) {
301301
<option disabled hidden value="">{"---Choose Assessment---"}</option>
302302
{
303303
allAssessments?.data &&
304-
(allAssessments?.data.map((element) => {
304+
(allAssessments?.data?.map((element) => {
305305
return (
306306
<option value={element.id}>{element.title}</option>)
307307
})
@@ -368,7 +368,7 @@ function GradingBox(props: any) {
368368
<option value="Letter Grades">Letter Grades</option>
369369
<option value="Pass/Fail">Pass/Fail</option>
370370
</select>
371-
{rateType.map((element) => {
371+
{rateType?.map((element) => {
372372
return (element.attribute === "main" &&
373373
((element.type === "Linear Scale" || element.type === "Letter Grades") ?
374374

@@ -500,7 +500,7 @@ function GradingBox(props: any) {
500500
</div>
501501
{
502502
(newAttribute.length > 0) &&
503-
newAttribute.map((element, index) => {
503+
newAttribute?.map((element, index) => {
504504
return (
505505
<div className="input mt-4 mb-5 " key={element}>
506506
<div className="grouped-input flex h-full w-full space-x-1 rounded-md">
@@ -532,7 +532,7 @@ function GradingBox(props: any) {
532532
<option value="Letter Grades">Letter Grades</option>
533533
<option value="Pass/Fail">Pass/Fail</option>
534534
</select>
535-
{rateType.map((item) => {
535+
{rateType?.map((item) => {
536536
return (item.attribute === element &&
537537
(
538538
(item.type === "Linear Scale" || item.type === "Letter Grades") ?
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from "react";
2+
import AdminHeader from "../../../components/sidebar/navHeader";
3+
import Sidebar from "../../../components/sidebar/sidebar";
4+
import { Outlet } from "react-router";
5+
const AdminLayout = () => {
6+
return (
7+
<>
8+
<div className="bg-slate-400 h-screen">
9+
<div className="bg-red-300 w-full h-[70px]">
10+
<AdminHeader />
11+
</div>
12+
<div className="flex w-full">
13+
<div className="w-[16rem] h-full">
14+
<Sidebar />
15+
</div>
16+
<main className="flex w-[100%] justify-center items-center flex-1">
17+
<Outlet />
18+
</main>
19+
</div>
20+
</div>
21+
</>
22+
);
23+
};
24+
25+
export default AdminLayout;

src/components/ReusableComponents/Select.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ const SelectField: React.FC<SelectFieldProps> = ({
3434
className={`dark:bg-dark-tertiary dark:text-white shadow appearance-none py-2 px-3 rounded w-full leading-tight focus:outline-none focus:shadow-outline ${className}`}
3535
onBlur={(e: React.FocusEvent<HTMLSelectElement>) => onBlur?.(e)}
3636
>
37-
{options.map((option) => (
38-
<option key={option.value} value={option.value}>
39-
{option.label}
37+
{options?.map((option) => (
38+
<option key={option?.value} value={option?.value}>
39+
{option?.label}
4040
</option>
4141
))}
4242
</select>

0 commit comments

Comments
 (0)