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

Inct 92 valid #97

Merged
merged 10 commits into from
Mar 19, 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
6 changes: 6 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ const nextConfig = {
port: '',
pathname: '/users-inctagram/**',
},
{
protocol: 'https',
hostname: 'staging-it-incubator.s3.eu-central-1.amazonaws.com',
port: '',
pathname: '/trainee-instagram-api/**',
},
],
},
}
Expand Down
5 changes: 1 addition & 4 deletions src/shared/assets/swiperStyle/post-images-slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
.swiper-pagination-custom,
.swiper-horizontal > .swiper-pagination-bullets,
.swiper-pagination-bullets.swiper-pagination-horizontal {

@media screen and (width<=910px) {
top: 86%;
left: 30%;
Expand All @@ -21,10 +20,8 @@

@media screen and (width<=459px) {
top: 77%;

}
}


.swiper-button-prev::after,
.swiper-button-next::after {
Expand All @@ -40,7 +37,7 @@
font-weight: bold;
color: rgb(255 255 255);
}

.swiper-button-prev::after,
.swiper-button-next::after {
padding: 10px;
Expand Down
1 change: 0 additions & 1 deletion src/shared/components/button/button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@

&:active {
background-color: rgb(10 102 56 / 0%);
border: 2px solid var(--color-accent-700);
}

&:focus-visible {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/dropdown/dropdown.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
z-index: 0;
top: -3px;
right: -1px;
// transform: rotate(45deg);
// transform: rotate(45deg);

width: 7px;
height: 7px;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.buttonBox {
display: flex;
gap: 24px;
justify-content: flex-end;
margin-top: 42px;
}

.avatar {
display: flex;
align-items: center;
justify-content: center;

min-width: 36px;
height: 36px;

background-position: center;
border: 1px solid var(--color-dark-100);
border-radius: 50%;
}

.avaAndText {
display: flex;
gap: 12px;
align-items: center;
}
56 changes: 56 additions & 0 deletions src/shared/components/followers-modal/addFollowers/AddFollower.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import s from './AddFollower.module.scss'

import { IconUser } from '@/shared/assets'
import { Button, Typography } from '@/shared/components'
import { Modal } from '@/shared/components/modals'
import { useTranslation } from '@/shared/lib'
import { useModal } from '@/shared/lib/hooks/open-or-close-hook'

type Props = {
avatar: string
name: string
isMob: boolean
onAdd: () => void
}
export const AddFollowers = ({ avatar, name, isMob, onAdd }: Props) => {
const { isOpen, openModal, closeModal } = useModal()
const { t } = useTranslation()

return (
<>
{/*<Button*/}
{/* variant={'link'}*/}
{/* onClick={() => openModal()}*/}
{/* style={isMob ? {fontSize: '14px', padding: '5px 10px', color: '#fff'} : {color: '#fff'}}*/}
{/*>*/}
{/* {t.followers_modal.button_remove}*/}
{/*</Button>*/}
<Button
variant={'primary'}
onClick={() => openModal()}
style={isMob ? { fontSize: '14px', padding: '5px 10px', color: '#fff' } : { color: '#fff' }}
>
{t.following_modal.follow_button}
</Button>

<Modal open={isOpen} size={'sm'} title={t.followers_modal.button_remove} onClose={closeModal}>
<div className={s.avaAndText}>
<div className={s.avatar} style={{ backgroundImage: avatar ? `${avatar}` : 'none' }}>
{!avatar && <IconUser />}
</div>
<Typography>
{t.add_following.text} {name}?
</Typography>
</div>
<div className={s.buttonBox}>
<Button variant={'outline'} onClick={onAdd} style={{ width: '27px' }}>
{t.delete_photo_of_profile.button_yes}
</Button>
<Button variant={'primary'} onClick={closeModal}>
{t.delete_photo_of_profile.button_no}
</Button>
</div>
</Modal>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './AddFollower'
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@ import { useRouter } from 'next/router'
import s from './DataOfFollowers.module.scss'

import { IconUser } from '@/shared/assets'
import { Button, Input } from '@/shared/components'
import { Input } from '@/shared/components'
import { AddFollowers } from '@/shared/components/followers-modal/addFollowers'
import { RemoveFollower } from '@/shared/components/followers-modal/deleteFollowers'
import { useTranslation } from '@/shared/lib'
export const followersArray = [
{ avatar: '', value: '1', title: 'URLProfile', isUnfollow: false },
{ avatar: '', value: '2', title: 'URLProfile', isUnfollow: false },
{ avatar: '', value: '3', title: 'URLProfile', isUnfollow: true },
{ avatar: '', value: '4', title: 'URLProfile', isUnfollow: false },
{ avatar: '', value: '5', title: 'URLProfile', isUnfollow: false },
{ avatar: '', value: '6', title: 'URLProfile', isUnfollow: false },
{ avatar: '', value: '7', title: 'URLProfile', isUnfollow: true },
]

export const DataOfFollowers = () => {
const { t } = useTranslation()
const router = useRouter()
const [shouldTruncate, setShouldTruncate] = useState(false)
const [followersArray, setFollowersArray] = useState([
{ avatar: '', value: '1', title: 'URLProfile', isUnfollow: false },
{ avatar: '', value: '2', title: 'URLProfile', isUnfollow: false },
{ avatar: '', value: '3', title: 'URLProfile', isUnfollow: true },
{ avatar: '', value: '4', title: 'URLProfile', isUnfollow: false },
{ avatar: '', value: '5', title: 'URLProfile', isUnfollow: false },
{ avatar: '', value: '6', title: 'URLProfile', isUnfollow: false },
{ avatar: '', value: '7', title: 'URLProfile', isUnfollow: true },
])

useEffect(() => {
if (router.pathname === '/my-profile/following-page/[subscription]') {
Expand All @@ -31,12 +33,25 @@ export const DataOfFollowers = () => {
}
}, [router.pathname])

const handleRemoveFollower = (index: number) => {
const updatedFollowersArray = [...followersArray]

updatedFollowersArray.splice(index, 1)
setFollowersArray(updatedFollowersArray)
}
const handleAddFollower = (index: number) => {
const updatedFollowersArray = [...followersArray]

updatedFollowersArray[index].isUnfollow = !updatedFollowersArray[index].isUnfollow
setFollowersArray(updatedFollowersArray)
}

return (
<>
<Input type={'search'} placeholder={t.following_modal.input_placeholder} />

<ul>
{followersArray.map(follower => {
{followersArray.map((follower, index) => {
const truncatedTitle =
shouldTruncate && follower.title.length >= 5
? `${follower.title.substring(0, 2)}...`
Expand All @@ -56,22 +71,19 @@ export const DataOfFollowers = () => {
{truncatedTitle}
</span>
{!follower.isUnfollow && (
<Button
variant={'primary'}
style={
shouldTruncate
? { fontSize: '14px', padding: '5px 10px', color: '#fff' }
: { fontSize: '16px' }
}
>
{t.following_modal.follow_button}
</Button>
<AddFollowers
avatar={follower.avatar}
isMob={shouldTruncate}
name={follower.title}
onAdd={() => handleAddFollower(index)}
/>
)}
<div className={s.deleteButtonBox}>
<RemoveFollower
avatar={follower.avatar}
isMob={shouldTruncate}
name={follower.title}
onRemove={() => handleRemoveFollower(index)}
/>
</div>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import { Button, Typography } from '@/shared/components'
import { Modal } from '@/shared/components/modals'
import { useTranslation } from '@/shared/lib'
import { useModal } from '@/shared/lib/hooks/open-or-close-hook'

type Props = {
avatar: string
name: string
isMob: boolean
onRemove: () => void
}
export const RemoveFollower = ({ avatar, name, isMob }: Props) => {
export const RemoveFollower = ({ avatar, name, isMob, onRemove }: Props) => {
const { isOpen, openModal, closeModal } = useModal()
const { t } = useTranslation()

Expand All @@ -34,7 +36,7 @@ export const RemoveFollower = ({ avatar, name, isMob }: Props) => {
</Typography>
</div>
<div className={s.buttonBox}>
<Button variant={'outline'} style={{ width: '27px' }}>
<Button variant={'outline'} onClick={onRemove} style={{ width: '27px' }}>
{t.delete_photo_of_profile.button_yes}
</Button>
<Button variant={'primary'} onClick={closeModal}>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/components/imageCard/ui/imageCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export const ImageCard = ({ postId, src, alt, cardClassName, width, height, open
onClick={
openModal
? () => {
openModal(postId)
}
openModal(postId)
}
: () => null
}
>
Expand Down
6 changes: 3 additions & 3 deletions src/shared/components/popover-menu/PopoverMenu.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
border: 1px solid var(--color-dark-100);
border-radius: 2px;
box-shadow:
0 10px 38px -10px rgb(22 23 24 / 35%),
0 10px 20px -15px rgb(22 23 24 / 20%);
}
0 10px 38px -10px rgb(22 23 24 / 35%),
0 10px 20px -15px rgb(22 23 24 / 20%);
}
Loading