Skip to content
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

feat: Small styling refinements for feedback #2809

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion editor.planx.uk/src/components/Feedback/FeedbackForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ const FeedbackForm: React.FC<FormProps> = ({ inputs, handleSubmit }) => {
<StyledForm>
<FormInputs inputs={inputs} />
<FeedbackDisclaimer />
<Button type="submit" variant="contained" sx={{ marginTop: 2.5 }}>
<Button
type="submit"
variant="contained"
color="prompt"
sx={{ marginTop: 2.5 }}
>
Send feedback
</Button>
</StyledForm>
Expand Down
30 changes: 10 additions & 20 deletions editor.planx.uk/src/components/Feedback/MoreInfoFeedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Box from "@mui/material/Box";
import Container from "@mui/material/Container";
import { styled } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
import { contentFlowSpacing } from "@planx/components/shared/Preview/Card";
import {
getInternalFeedbackMetadata,
insertFeedbackMutation,
Expand All @@ -23,11 +22,6 @@ const MoreInfoFeedback = styled(Box)(({ theme }) => ({
},
}));

const FeedbackBody = styled(Box)(({ theme }) => ({
padding: theme.spacing(1, 0),
"& form > * + *": contentFlowSpacing(theme),
}));

const MoreInfoFeedbackComponent: React.FC = () => {
type View = "yes/no" | "input" | "thanks";

Expand Down Expand Up @@ -77,7 +71,7 @@ const MoreInfoFeedbackComponent: React.FC = () => {
<Typography variant="h4" component="h3" gutterBottom>
Did this help to answer your question?
</Typography>
<FeedbackBody>
<Box>
<FeedbackOption
onClick={() => handleFeedbackOptionClick("helpful")}
Icon={CheckCircleIcon}
Expand All @@ -90,7 +84,7 @@ const MoreInfoFeedbackComponent: React.FC = () => {
label="No"
format="negative"
/>
</FeedbackBody>
</Box>
</Container>
</MoreInfoFeedback>
);
Expand All @@ -110,12 +104,10 @@ const MoreInfoFeedbackComponent: React.FC = () => {
<Typography variant="h4" component="h3" gutterBottom>
Please help us to improve this service by sharing feedback
</Typography>
<FeedbackBody>
<FeedbackForm
inputs={commentFormInputs}
handleSubmit={handleFeedbackFormSubmit}
/>
</FeedbackBody>
<FeedbackForm
inputs={commentFormInputs}
handleSubmit={handleFeedbackFormSubmit}
/>
</Container>
</MoreInfoFeedback>
);
Expand All @@ -128,12 +120,10 @@ const MoreInfoFeedbackComponent: React.FC = () => {
<Typography variant="h4" component="h3" gutterBottom>
Thank you for your feedback.
</Typography>
<FeedbackBody>
<Typography variant="body2">
We value the time you’ve taken to share. We’ll use your insights
to improve our services.
</Typography>
</FeedbackBody>
<Typography variant="body2" pt={1}>
We value the time you’ve taken to share. We’ll use your insights to
improve our services.
</Typography>
</Container>
</MoreInfoFeedback>
);
Expand Down
4 changes: 2 additions & 2 deletions editor.planx.uk/src/ui/public/FeedbackOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const ArrowButton = styled("span")(({ theme }) => ({
display: "flex",
justifyContent: "center",
alignItems: "center",
backgroundColor: theme.palette.primary.main,
color: theme.palette.common.white,
backgroundColor: theme.palette.prompt.main,
color: theme.palette.prompt.contrastText,
width: "36px",
height: "36px",
flexShrink: "0",
Expand Down
Loading