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

fix: fixed modal responsive issues #90

Merged
merged 48 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bc08b55
feat:Added new site data and some minor changes
ayussh-2 Jun 11, 2024
15c278e
feat: added updated events section
ayussh-2 Jun 11, 2024
7f1bedd
Merge branch 'main' into ayush
ayussh-2 Jun 11, 2024
84ce37c
chore: added text sizes from tailwind
ayussh-2 Jun 11, 2024
60f6c3f
feat: added Registartion page
ayussh-2 Jun 12, 2024
c40af02
Merge branch 'main' into ayush
ayussh-2 Jun 12, 2024
881d060
chore:updated backgrounf image of Registerpage
ayussh-2 Jun 12, 2024
610e1b3
chore: changes after conflict
ayussh-2 Jun 12, 2024
ca85927
chore: few fixes
ayussh-2 Jun 12, 2024
22b6418
Merge branch 'main' into ayush
ayussh-2 Jun 12, 2024
52d53d3
chore:updatd bg
ayussh-2 Jun 12, 2024
0a3a796
Merge branch 'main' into ayush
ayussh-2 Jun 12, 2024
836369f
Merge branch 'dscnitrourkela:main' into ayush
ayussh-2 Jun 17, 2024
b2c528d
added registration form and cloudinary api
ayussh-2 Jun 17, 2024
41fb200
chore:cloudinary fix and google sign in fix
ayussh-2 Jun 18, 2024
340f6a4
chore: added queries and mutaitions
ayussh-2 Jun 18, 2024
df86ca2
chore:added zod validation
ayussh-2 Jun 18, 2024
ce5077f
chore:validation fix
ayussh-2 Jun 18, 2024
13f01bc
fix: fixed according to the changes
ayussh-2 Jun 19, 2024
2781206
chore: improvements to form and added cookies.
ayussh-2 Jun 19, 2024
c16151e
chore: removed cookies and added GET_USER_BY_ID check
ayussh-2 Jun 20, 2024
e7d6a8f
Merge branch 'main' into registrationForm
ayussh-2 Jun 20, 2024
989da46
fix:prettier
ayussh-2 Jun 20, 2024
bc1327d
Merge branch 'registrationForm' of https://github.com/ayussh-2/projec…
ayussh-2 Jun 20, 2024
8d50c8e
fix: prettier formatting
ayussh-2 Jun 20, 2024
5238ae1
fix: fixed authcotext err
ayussh-2 Jun 20, 2024
23928d8
Merge branch 'main' into registrationForm
anmol5936 Jun 20, 2024
6696842
fix: added fixes to query and mutations
ayussh-2 Jun 20, 2024
945cf8f
feat: started profile view in progress
ayussh-2 Jun 21, 2024
abbfef6
chore:ui finished
ayussh-2 Jun 21, 2024
8f1749f
Merge branch 'main' into registrationForm
Srish-ty Jun 21, 2024
670fac9
feat:completed profile menu
ayussh-2 Jun 21, 2024
7f72041
Merge branch 'registrationForm' of https://github.com/ayussh-2/projec…
ayussh-2 Jun 21, 2024
2b9c3ee
Merge branch 'main' into registrationForm
Srish-ty Jun 21, 2024
1dab074
chore:added college
ayussh-2 Jun 21, 2024
e904bd5
Merge branch 'registrationForm' of https://github.com/ayussh-2/projec…
ayussh-2 Jun 21, 2024
0b7ce61
Merge branch 'dscnitrourkela:main' into registrationForm
ayussh-2 Jun 27, 2024
140e45d
Merge branch 'main' into registrationForm
anmol5936 Jul 6, 2024
be9a790
Merge branch 'main' into registrationForm
ayussh-2 Jul 8, 2024
d172856
chore:authenticates user
ayussh-2 Jul 8, 2024
69e9a29
chore: footer toast fixes and registration form fixes
ayussh-2 Jul 8, 2024
bd9c686
added orgId to fix authorization error
ayussh-2 Jul 9, 2024
8bf8bc6
fix:some fixes
ayussh-2 Jul 9, 2024
8941447
fix: important fixes
ayussh-2 Jul 9, 2024
a6951f9
fix: responsiveness update on eventModal
ayussh-2 Jul 10, 2024
504e9dd
Merge branch 'main' into av3
ayussh-2 Jul 10, 2024
bb8a5f6
fix: lint:fix
ayussh-2 Jul 10, 2024
8e8a665
Merge branch 'av3' of https://github.com/ayussh-2/project-vanilla int…
ayussh-2 Jul 10, 2024
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
18 changes: 16 additions & 2 deletions src/components/events/EventModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import {
CardList,
ListItems,
Section,
ButtonRules
ButtonRules,
ProgressBar
} from './eventModal.styles'

import { useState } from 'react'
import { XIcon } from '../../config/index'
import PropTypes from 'prop-types'

Expand All @@ -29,12 +31,24 @@ EventModal.propTypes = {
})
}
function EventModal({ closeModal, event: { img, title, subtitle, details, rules } }) {
const [scrollPosition, setScrollPosition] = useState(0)

function handleScroll(e) {
const element = e.target
const scrollTop = element.scrollTop
const scrollHeight = element.scrollHeight - element.clientHeight
const scrollPercentage = (scrollTop / scrollHeight) * 100
setScrollPosition(scrollPercentage)
}

function redirectToRules() {
window.open(rules, '_blank')
}

return (
<Container>
<Section>
<Section onScroll={handleScroll}>
<ProgressBar width={scrollPosition} />
<CloseButton onClick={closeModal}>
<img src={XIcon} alt="close" />
</CloseButton>
Expand Down
17 changes: 12 additions & 5 deletions src/components/events/eventModal.styles.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import tw from 'twin.macro'
import styled, { keyframes } from 'styled-components'
import tw from 'twin.macro'

const fadeInAnimation = keyframes`
from {
Expand All @@ -11,14 +11,21 @@ const fadeInAnimation = keyframes`
transform: scale(1);
}
`

export const Container = styled.main`
${tw`fixed inset-0 z-50 bg-brown-2 bg-opacity-75 backdrop-blur-md flex justify-center items-center w-screen px-[1rem] md:px-[10px] `}
${tw`fixed inset-0 z-50 bg-brown-2 bg-opacity-75 backdrop-blur-md flex justify-center items-center w-screen px-[1rem] md:px-[10px]`}
animation: ${fadeInAnimation} 0.3s ease-out;
`

export const Section = styled.section`
${tw`bg-black-1 text-brown-2 relative max-w-[600px] w-full rounded-[23.06px] font-Poppins max-h-[95vh]`}
${tw`bg-black-1 text-brown-2 relative max-w-[600px] w-full rounded-[23.06px] font-Poppins max-h-[95vh] h-auto overflow-scroll`}
padding-top: 10px;
scrollbar-width: none;
`

export const ProgressBar = styled.div`
${tw`fixed top-0 left-0 h-1 bg-orange-500`}
width: ${({ width }) => width}%;
transition: width 0.1s ease-out;
`

export const ContentWrapper = styled.div`
Expand Down Expand Up @@ -46,7 +53,7 @@ export const CardSubtitle = styled.h3`
`

export const CardBody = styled.div`
${tw`my-5 h-[180px] 0.5xxsm:h-[250px] xxsm:h-[300px] overflow-y-scroll px-5`}
${tw`my-5 px-5`}
`

export const CardList = styled.ul`
Expand Down
Loading