Skip to content

Commit

Permalink
[#21] Fix question path and apply currentColor to close-btn
Browse files Browse the repository at this point in the history
  • Loading branch information
manh-t committed Sep 5, 2023
1 parent 05fe833 commit cf449dd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 3 additions & 6 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ import SurveyScreen from 'screens/Survey';

import ProtectedRoute from './ProtectedRoute';

export const questionPath = 'questions';

export const paths = {
root: '/',
signIn: '/sign-in',
survey: '/surveys/:id',
question: '/surveys/:id/questions',
};

export const questionPath = (): string => {
const questionPaths = paths.question.split('/');
return questionPaths[questionPaths.length - 1];
question: `/surveys/:id/${questionPath}`,
};

const routes: RouteObject[] = [
Expand Down
4 changes: 2 additions & 2 deletions src/screens/Question/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import { ReactComponent as ArrowRight } from 'assets/images/icons/arrow-right.svg';
import { ReactComponent as CloseButton } from 'assets/images/icons/close-btn-white.svg';
import { ReactComponent as CloseButton } from 'assets/images/icons/close-btn.svg';
import AppSlider from 'components/AppSlider';
import MainView from 'components/MainView';

Expand All @@ -16,7 +16,7 @@ const QuestionScreen = (): JSX.Element => {
return (
<MainView backgroundUrl="https://dhdbhh0jsld0o.cloudfront.net/m/1ea51560991bcb7d00d0_">
<div className="flex flex-col h-full">
<button className="mt-8 mr-8 p-1 self-end" data-test-id={questionScreenTestIds.closeButton}>
<button className="mt-8 mr-8 p-1 self-end text-white" data-test-id={questionScreenTestIds.closeButton}>
<CloseButton />
</button>
<div className="w-1/2 self-center flex-1 flex flex-col justify-center">
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Survey/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const SurveyScreen = (): JSX.Element => {
{survey?.description}
</p>
<div className="pt-8">
<Link to={questionPath()}>
<Link to={questionPath}>
<ElevatedButton isFullWidth type="submit" data-test-id={surveyScreenTestIds.startSurveyButton}>
Start Survey
</ElevatedButton>
Expand Down

0 comments on commit cf449dd

Please sign in to comment.