Skip to content

Commit

Permalink
Merge pull request #264 from LL08-MathematicalModelling-dowell/ft-pranai
Browse files Browse the repository at this point in the history
Ft pranai
  • Loading branch information
norahwinda authored Jun 4, 2024
2 parents b308d94 + 3de243d commit 7c128b6
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 106 deletions.
2 changes: 1 addition & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function App() {
const location = useLocation();
const { slug } = useParams();
const isHome = location.pathname === '/100035-DowellScale-Function//home';
const masterLink = location.pathname === `/100035-DowellScale-Function/home/master-link`;
const masterLink = location.pathname.includes(`/home/master-link`)
const scale = location.pathname === `/100035-DowellScale-Function/home/master-link/scale`;

const [isSidebarVisible, setIsSidebarVisible] = useState(true);
Expand Down
9 changes: 5 additions & 4 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,15 @@ const router = createBrowserRouter([
path: `${basePath}/home/generate-report/:slug`,
element: <GenerateReport />,
},
{
path: `${basePath}/home/master-link/:slug`,
element: <Booth />,
},
{
path: `${basePath}/home/master-link`,
element: <Booth />,
},
// {
// path: `${basePath}/home/master-link/:slug`,
// element: <Booth />,
// }
,
{
path: `${basePath}/home/master-link/scale`,
element: <NpsScaleTest />,
Expand Down
13 changes: 8 additions & 5 deletions src/pages/scales/report/Booth.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import React from 'react'
import { useState, useEffect} from 'react';
import { Link, useSearchParams } from "react-router-dom";
import { Link, useParams, useSearchParams } from "react-router-dom";

const Booth = () => {

const [boothInput, setBoothInput] = useState()
const [searchParams, setSearchParams] = useSearchParams({});
const {slug}=useParams()
console.log(slug)
const [searchParams, setSearchParams] = useSearchParams();
console.log(searchParams.get("scale_id"))
let currentUrlParams = new URLSearchParams(window.location.search);

useEffect(()=>{
setSearchParams({ scale_id: "665a8277d5d158ec8391aaf7" });
}, [])
// useEffect(()=>{
// setSearchParams({ scale_id: "665a8277d5d158ec8391aaf7" });
// }, [])

const handleGoButton = () =>{
console.log(boothInput)
Expand Down
4 changes: 3 additions & 1 deletion src/pages/scales/staple-scale/StapleScale.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// import Fallback from '../../../components/Fallback';
// import { Button } from '../../../components/button';

import ScaleMainScreen from "../ui-scales-helper/ScaleMainScreen";



// const StapleScale = () => {
Expand Down Expand Up @@ -90,6 +90,8 @@ import ScaleMainScreen from "../ui-scales-helper/ScaleMainScreen";

// export default StapleScale

import ScaleMainScreen from "../ui-scales-helper/ScaleMainScreen";

export default function StapleScale(){
const textContent = {
scale: "STAPEL SCALE",
Expand Down
18 changes: 2 additions & 16 deletions src/pages/scales/ui-scales-helper/ConfigureScale.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,7 @@ function handleNext(){

return(
<>
<style scoped>
{
`
.channel-changes{
display: grid;
}
@media(min-width:968px){
.channel-changes{
display: flex
}
}
`
}
</style>


<div className="flex flex-col gap-5 items-center text-[16px]" style={{ fontFamily: 'Roboto, sans-serif' }}>
<div className="w-max flex flex-col lg:justify-center lg:items-center">
Expand Down Expand Up @@ -223,7 +209,7 @@ function handleNext(){
{formData.channels.map((channel,index1)=>(
<>

<div key={index1} className="flex flex-col lg:flex-row lg:justify-center lg:items-center gap-5 mt-5 channel-changes lg:ml-8">
<div key={index1} className="grid lg:flex lg:flex-row lg:justify-center lg:items-center gap-5 mt-5 lg:ml-8">
<p className="hidden lg:block mt-9 font-medium text-[18px]">{index1+1}.</p>
<div className="flex flex-col justify-start items-start gap-1">

Expand Down
89 changes: 10 additions & 79 deletions src/pages/scales/ui-scales-helper/ScaleMainScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,88 +129,19 @@ return (

{!buttonLinksGenerated ? (
<>
<style scoped>
{`
.div-changes {
padding: 40px 10px;
margin-left: 20px;
}
.content-changes {
width: 100px;
font-size: 0.8rem;
}
@media (min-width: 768px) {
.div-changes {
padding: 40px;
margin-left: 56px;
}
.content-changes {
width: 150px;
font-size:1rem
}
}
.text-changes {
font-size: 0.8rem;
}
@media (min-width:523px) {
.text-changes {
font-size: 1rem;
}
}
.button-changes {
padding: 0.3rem;
font-size: 10px;
}
@media(min-width:640px) {
.button-changes {
padding: 0.5rem;
font-size: 10px;
}
}
@media(min-width:670px) {
.button-changes {
padding: 0.5rem;
font-size: 12px;
}
}
@media(min-width:905px) {
.button-changes {
padding: 0.5rem;
padding-left: 1rem;
padding-right: 1rem;
font-size: 18px;
}
}
@media(min-width:1152px) {
.button-changes {
padding: 0.5rem;
padding-left: 3rem;
padding-right: 3rem;
font-size: 18px;
}
}
@media(min-width:1400px) {
.button-changes {
padding: 0.5rem;
padding-left: 5rem;
padding-right: 5rem;
font-size: 18px;
}
}
`}
</style>


<div className="mt-5 bg-[#E8E8E8] rounded-lg h-max w-[90%] sm:w-[80%] div-changes">
<div className="mt-5 bg-[#E8E8E8] rounded-lg h-max w-[90%] sm:w-[80%] p-5">
<div className="flex flex-col justify-start items-start">
<p className="font-medium">{textContent.scaleEg}</p>
<p className="text-[14px]">{textContent.scaleDescription}</p>
</div>
<p className="flex justify-center items-center font-sans p-3 mt-5 text-changes">{textContent.experiencePrompt}</p>
{textContent.experience[0]=="Bad" ? (
<div className="flex justify-center items-center gap-12 mt-5">
<button className="bg-[#ff4a4a] rounded button-changes">{textContent.experience[0]}</button>
<button className="bg-[#f3dd1f] rounded button-changes">{textContent.experience[1]}</button>
<button className="bg-[#129561] rounded button-changes">{textContent.experience[2]}</button>
{typeof textContent.experience[0]=="string" && textContent.experience[0].includes("Bad") ? (
<div className="flex justify-center items-center gap-3 sm:gap-12 mt-5">
<button className="bg-[#ff4a4a] rounded sm:px-5 lg:px-10 p-2 text-[12px] sm:text-[16px]">{textContent.experience[0]}</button>
<button className="bg-[#f3dd1f] rounded sm:px-5 lg:px-10 p-2 text-[12px] sm:text-[16px]">{textContent.experience[1]}</button>
<button className="bg-[#129561] rounded sm:px-5 lg:px-10 p-2 text-[12px] sm:text-[16px]">{textContent.experience[2]}</button>
</div>
):(

Expand All @@ -234,11 +165,11 @@ return (
</div>
</div>
):(
<div className="flex justify-center items-center gap-1 sm:gap-3 bg-white p-1 md:p-4 lg:px-8 border-2 border-[#bfbfbf] w-max">
<div className="flex justify-center items-center gap-3 bg-white p-1 md:p-4 lg:px-8 border-2 border-[#bfbfbf] w-max">
{textContent.experience.map((score, index)=>(
<button
key={index}
className=" text-[12px] md:text-[14px] py-[8px] px-[2px] sm:p-1 sm:px-2 rounded md:p-2 md:px-4 bg-[#00a3ff] text-white "
className=" text-[12px] md:text-[14px] p-1 px-2 rounded md:p-2 md:px-4 bg-[#00a3ff] text-white "
>
{score}
</button>
Expand All @@ -252,7 +183,7 @@ return (

</div>

<div className="mt-14 pt-10 bg-[#E8E8E8] rounded-lg h-max w-[90%] sm:w-[80%] div-changes">
<div className="mt-14 pt-10 bg-[#E8E8E8] rounded-lg h-max w-[90%] sm:w-[80%] ">
{!confirmed ? (
<>
{textContent.scale!=="LIKERT SCALE" ? (
Expand Down

0 comments on commit 7c128b6

Please sign in to comment.