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: create campaign application organizer form (Epic #1842) #1863

Conversation

teodorazhelyazkova
Copy link
Contributor

@teodorazhelyazkova teodorazhelyazkova commented Jun 24, 2024

Create campaign application organizer form connected to Epic #1842
I have used for reference the src/components/client/support-form/SupportForm.tsx

Screenshots:

1

Testing

Steps to test

  1. Login as normal user
  2. Visit http://localhost:3040/campaigns/application

Copy link

github-actions bot commented Jun 24, 2024

✅ Tests will run for this PR. Once they succeed it can be merged.

Copy link
Contributor

@gparlakov gparlakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Copy link
Member

@sashko9807 sashko9807 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the style repetitiveness topic, there is no rule saying that each component we want to style should be a styled component. You can have single single styled wrapper, and define the styles of all child components through CSS selectors(elements, classes etc..).

For example you could have something like

export const OrganizerDataStepStyled = styled(Grid)(() => ({
 '& .header': {
     fontSize: theme.typography.pxToRem(18)
     ....
  },
 'input': {
     fontSize: theme.typography.pxToRem(18)
     borderRadius: 10
    .....
  },
 'button': {
  padding: theme.spacing(1, 5),
  border: `1px solid ${theme.palette.common.black}`,
  borderRadius: theme.borders.round,
  color: theme.palette.common.black,
  fontSize: theme.typography.pxToRem(15),
  fontWeight: 800,
  }
})

Then you use it like this

//OrganizerDataStepStyled inherits all properties of the Grid component
<OrganizerDataStepStyled container>
<Header className={'header'}>Something nice</Header>
<Button variant='outline'>Go back</Button>
<Button variant='contained'>Save and continue</Button>
</OrganizerDataStepStyled>

You can find this pattern used in the codebase to get the idea. Quick example I found is CampaignNewsList.tsx

P.S. This comment was just to give you an idea of alternative solution on how to work with MUI's styled components. We don't have a strict policy(at least for now), when it comes to building patterns for react component, thus feel free to use the pattern which comes more natural/logical to you.

@sashko9807 sashko9807 added the run tests Allows running the tests workflows for forked repos label Jun 26, 2024
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Jun 26, 2024
@sashko9807 sashko9807 merged commit 8c6e1a0 into podkrepi-bg:master Jun 26, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants