-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from Lapkipomoshi/dev
test-deploy: june-1
- Loading branch information
Showing
57 changed files
with
885 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/components/ProfileSheltersBlock/ProfileSheltersBlock.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import './ProfileSheltersBlock.scss'; | ||
import ShelterCard from '../ShelterCard/ShelterCard'; | ||
import Button from '../../ui/Button/Button'; | ||
|
||
const ProfileSheltersBlock = ({ shelters, sheltersTitle, owner }) => { | ||
return ( | ||
<div className='profile-shelters'> | ||
{shelters && shelters.length !== 0 && | ||
<div className='profile-shelters__container'> | ||
<h3 className='profile-shelters__title standard-font standard-font_type_h3'>{sheltersTitle}</h3> | ||
|
||
<ul className='profile-shelters__shelters-container'> | ||
{shelters.map((shelter) => { | ||
return ( | ||
<li key={shelter.id}> | ||
<ShelterCard | ||
id={shelter.id} | ||
name={shelter.name} | ||
address={shelter.address} | ||
workingFromHour={shelter.working_from_hour} | ||
workingToHour={shelter.working_to_hour} | ||
workingHours={shelter.working_hours} | ||
logo={shelter.logo} | ||
profileImage={shelter.profile_image} | ||
/> | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
|
||
{owner && <Button link to='/'>Перейти в приют</Button>} | ||
|
||
</div> | ||
} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ProfileSheltersBlock; |
21 changes: 21 additions & 0 deletions
21
src/components/ProfileSheltersBlock/ProfileSheltersBlock.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.profile-shelters__container { | ||
display: flex; | ||
flex-direction: column; | ||
margin-bottom: 44px; | ||
} | ||
|
||
.profile-shelters__title { | ||
margin-top: 0; | ||
margin-bottom: 28px; | ||
} | ||
|
||
.profile-shelters__shelters-container { | ||
display: flex; | ||
flex-direction: row; | ||
column-gap: 24px; | ||
margin-top: 0; | ||
margin-bottom: 28px; | ||
padding: 0; | ||
z-index: 1; | ||
overflow: hidden; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
|
||
@media (min-width: 750px) { | ||
margin-top: 20px; | ||
flex-direction: row; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React, { useContext } from 'react'; | ||
import './ShelterOwnerProfile.scss'; | ||
import CurrentUserContext from '../../contexts/CurrentUserContext'; | ||
import ProfileSheltersBlock from '../../components/ProfileSheltersBlock/ProfileSheltersBlock'; | ||
|
||
const ShelterOwnerProfile = () => { | ||
const currentUser = useContext(CurrentUserContext); | ||
const { subscription_shelter } = currentUser; | ||
|
||
return ( | ||
<div> | ||
<ProfileSheltersBlock | ||
shelters={subscription_shelter} | ||
sheltersTitle='Ваши приюты' | ||
owner | ||
/> | ||
|
||
<ProfileSheltersBlock | ||
shelters={subscription_shelter} | ||
sheltersTitle='Ваши любимые приюты' | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ShelterOwnerProfile; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { useContext } from 'react'; | ||
import './UserProfile.scss'; | ||
import CurrentUserContext from '../../contexts/CurrentUserContext'; | ||
import ProfileSheltersBlock from '../../components/ProfileSheltersBlock/ProfileSheltersBlock'; | ||
|
||
const UserProfile = () => { | ||
const currentUser = useContext(CurrentUserContext); | ||
const { donations_sum, subscription_shelter } = currentUser; | ||
|
||
return ( | ||
<div> | ||
<div className='user-profile__donation'> | ||
<p className='user-profile__donation-text standard-font standard-font_type_body'>Вы пожертвовали приютам за всё время:</p> | ||
<div className='user-profile__donation-sum'> | ||
{ donations_sum } | ||
<p className='user-profile__donation-rubles'>рублей</p> | ||
</div> | ||
</div> | ||
|
||
<ProfileSheltersBlock | ||
shelters={subscription_shelter} | ||
sheltersTitle='Ваши любимые приюты' | ||
/> | ||
|
||
<ProfileSheltersBlock | ||
shelters={subscription_shelter} | ||
sheltersTitle='Приюты, которым вы помогли' | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default UserProfile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.user-profile__donation { | ||
display: flex; | ||
align-items: center; | ||
margin-bottom: 60px; | ||
} | ||
|
||
.user-profile__donation-text { | ||
margin-right: 16px; | ||
} | ||
|
||
.user-profile__donation-sum { | ||
border-width: 0 2px; | ||
border-style: solid; | ||
border-color: #FF852E; | ||
border-radius: 8px; | ||
padding-left: 20px; | ||
padding-right: 20px; | ||
min-height: 52px; | ||
max-width: 82px; | ||
font-weight: 500; | ||
font-size: 20px; | ||
line-height: 24px; | ||
color: #FF852E; | ||
text-align: center; | ||
margin: 0; | ||
} | ||
|
||
.user-profile__donation-rubles { | ||
margin: 0; | ||
font-weight: 400; | ||
font-size: 18px; | ||
line-height: 28px; | ||
color: #FF852E; | ||
} |
Oops, something went wrong.