Skip to content

Commit

Permalink
Merge pull request #153 from Andres2D/create-match-steper-responsive-…
Browse files Browse the repository at this point in the history
…design

Add resposive design to the create match page
  • Loading branch information
Andres2D authored Jan 4, 2023
2 parents 36804de + 44bd551 commit 99e0f19
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 5 deletions.
10 changes: 10 additions & 0 deletions components/matches/new/header/steps.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../../../styles/breakpoints';

.tabs {
margin-top: 50px;
color: #F7FAFC;
Expand All @@ -16,3 +18,11 @@
font-size: 20px;
}
}

@media (max-width: $medium-device-extra) {
.tabs {
.tabsList {
display: none;
}
}
}
2 changes: 1 addition & 1 deletion components/matches/new/header/steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Steps: NextPage<Props> = ({teams, players, schedule}) => {
index={form.current_step}
onChange={handleTabsChange}
>
<TabList>
<TabList className={styles.tabsList}>
<Tab
_selected={selectedTab}
className={styles.tab}
Expand Down
2 changes: 2 additions & 0 deletions components/matches/new/new-match.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../../styles/breakpoints';

.steps {
display: flex;
flex-direction: column;
Expand Down
10 changes: 10 additions & 0 deletions components/matches/new/place-date/place-date.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../../../styles/breakpoints';

.form {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -25,3 +27,11 @@
}
}
}

@media (max-width: $medium-device-extra) {
.form {
.formControl {
width: 90%;
}
}
}
19 changes: 19 additions & 0 deletions components/matches/new/players/players-form.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../../../styles/breakpoints';

.players {
display: flex;
flex-wrap: wrap;
Expand Down Expand Up @@ -26,3 +28,20 @@
}
}

@media (max-width: $medium-device-extra) {
.players,
.playerResult {
width: 90%;
}

.playerNameInput {
width: 90% !important;
}
}

@media (max-width: $extra-small-device) {
.completePlayers {
width: 90%;
}
}

4 changes: 3 additions & 1 deletion components/matches/new/players/players-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,20 @@ const PlayersForm: NextPage = () => {
mt='5'
ref={inputRef}
onChange={searchPlayer}
className={styles.playerNameInput}
/>
{playersResults}
<div className={styles.players}>
{playersAdded}
</div>
<Button
className={styles.completePlayers}
size='lg'
colorScheme='brand'
mt='5px'
onClick={autoCompletePlayers}
>
Auto complete players ({missingState - playersAdded.length})
Complete players ({missingState - playersAdded.length})
</Button>
</section>
);
Expand Down
37 changes: 36 additions & 1 deletion components/matches/new/team/team-form.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@import '../../../../styles/breakpoints';

.team {
margin-top: 50px;
display: flex;
flex-direction: column;
align-items: center;
color: #333;
text-align: center;
Expand All @@ -19,7 +23,7 @@
.shields {
margin: 10px;
display: flex;
justify-content: flex-start;
justify-content: center;
align-items: center;
align-content: space-between;
gap: 15px;
Expand All @@ -28,4 +32,35 @@
overflow-y: scroll;
}
}

.nameInput {
width: 50%;
}
}

@media (max-width: $medium-device-extra) {
.team {
width: 50%;

.title {
font-size: xx-large;
}

.shieldTeam {
.selectedShield {
width: 150px;
height: 150px;
}
}

.nameInput {
width: 90%;
}
}
}

@media (max-width: $medium-small-device) {
.team {
width: 90%;
}
}
5 changes: 3 additions & 2 deletions components/matches/new/team/team-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const TeamForm: NextPage<Props> = ({type = 'home'}: Props) => {
bgClip="text"
fontSize="6xl"
fontWeight="extrabold"
className={styles.title}
>
{`${type.charAt(0).toUpperCase()}${type.slice(1, type.length)}`}
</Text>
Expand All @@ -83,7 +84,7 @@ const TeamForm: NextPage<Props> = ({type = 'home'}: Props) => {
className={styles.selectedShield}
></Image>
</PopoverTrigger>
<PopoverContent>
<PopoverContent w='250px'>
<PopoverArrow />
<PopoverCloseButton />
<PopoverHeader>Team</PopoverHeader>
Expand All @@ -102,12 +103,12 @@ const TeamForm: NextPage<Props> = ({type = 'home'}: Props) => {
</div>
<Input
placeholder='Name of the team'
width={'50%'}
colorScheme='white'
variant='filled'
mt='5'
onChange={updateField}
ref={teamName}
className={styles.nameInput}
/>
</div>
);
Expand Down
15 changes: 15 additions & 0 deletions components/matches/new/teams/create-teams.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
@import '../../../../styles/breakpoints';

.form {
width: 80%;
display: flex;
justify-content: space-between;
}

@media (max-width: $medium-device-extra) {
.form {
width: 100%;
}
}

@media (max-width: $medium-small-device) {
.form {
flex-direction: column;
align-items: center;
}
}
1 change: 1 addition & 0 deletions styles/_breakpoints.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
$large-device: 995px;
$medium-large-device: 845px;
$medium-device-extra: 600px;
$medium-device: 565px;
$medium-small-device: 500px;
$small-device: 400px;
Expand Down

0 comments on commit 99e0f19

Please sign in to comment.