Skip to content

Commit fa7dab8

Browse files
authored
Merge pull request #714 from nwplus/dev
cmd-f stuff
2 parents 56bb84a + d0bbd69 commit fa7dab8

File tree

4 files changed

+33
-26
lines changed

4 files changed

+33
-26
lines changed

src/components/Rewards/TotalPoints.jsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,25 @@ const TotalPoints = ({ userDetails }) => {
4141
useEffect(() => {
4242
;(async () => {
4343
if (userDetails && dbHackathonName) {
44+
const userCheckedIn = userDetails.dayOf.checkedIn
4445
const eventIds = userDetails.dayOf.events.map(event => event.eventId)
4546
const events = await getEvents(dbHackathonName)
4647
const filteredEvents = events.filter(event => eventIds.includes(event.key))
4748
console.log(filteredEvents)
4849
// setName(`${userDetails.basicInfo.preferredName} ${userDetails.basicInfo.legalLastName}`)
49-
setTotalPoints(
50-
filteredEvents.reduce((accumulator, event) => {
51-
const points = parseInt(event.points) // Attempt to convert to integer
52-
if (!isNaN(points)) {
53-
// Only add valid numbers
54-
console.log('Adding Points:', points)
55-
return accumulator + points
56-
} else {
57-
console.log('Skipping Invalid Points:', event.points)
58-
return accumulator
59-
}
60-
}, 0)
61-
)
50+
const points = filteredEvents.reduce((accumulator, event) => {
51+
const points = parseInt(event.points) // Attempt to convert to integer
52+
if (!isNaN(points)) {
53+
// Only add valid numbers
54+
console.log('Adding Points:', points)
55+
return accumulator + points
56+
} else {
57+
console.log('Skipping Invalid Points:', event.points)
58+
return accumulator
59+
}
60+
}, 0)
61+
62+
setTotalPoints(userCheckedIn ? points + 15 : points)
6263
}
6364
})()
6465
}, [userDetails, dbHackathonName])

src/components/Social/ProfilePicturePopup.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,9 @@ const Grid = styled.div`
105105

106106
const ProfilePic = styled.img`
107107
width: 100%;
108-
height: 100%;
109108
object-fit: contain;
110109
cursor: pointer;
111-
border-radius: 100px;
110+
border-radius: 100%;
112111
border: 4px solid
113112
${p => (p.selected ? p.theme.colors.button.secondary.background.default : 'transparent')};
114113
transition: transform 0.3s ease;

src/components/Social/ViewSocial.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ const Name = styled.div`
169169
font-size: 2.5rem;
170170
font-weight: 700;
171171
color: ${p => p.theme.colors.text};
172+
173+
${p => p.theme.mediaQueries.mobile} {
174+
font-size: 2.25rem;
175+
max-width: 65%;
176+
text-align: center;
177+
word-wrap: break-word;
178+
}
172179
`
173180

174181
const Pronouns = styled.div`

src/containers/Rewards.jsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,21 +94,21 @@ const Rewards = () => {
9494
const userData = userDoc.data()
9595

9696
if (userData && dbHackathonName) {
97+
const userCheckedIn = userData.dayOf.checkedIn
9798
const eventIds = userData.dayOf.events.map(event => event.eventId)
9899
const events = await getEvents(dbHackathonName)
99100
const filteredEvents = events.filter(event => eventIds.includes(event.key))
100101
// setName(`${userData.basicInfo.preferredName} ${userData.basicInfo.legalLastName}`)
101-
setUserPoints(
102-
filteredEvents.reduce((accumulator, event) => {
103-
const points = parseInt(event.points) // Attempt to convert to integer
104-
if (!isNaN(points)) {
105-
// Only add valid numbers
106-
return accumulator + points
107-
} else {
108-
return accumulator
109-
}
110-
}, 0)
111-
)
102+
const points = filteredEvents.reduce((accumulator, event) => {
103+
const eventPoints = parseInt(event.points)
104+
if (!isNaN(eventPoints)) {
105+
return accumulator + eventPoints
106+
} else {
107+
return accumulator
108+
}
109+
}, 0)
110+
111+
setUserPoints(userCheckedIn ? points + 15 : points)
112112
}
113113

114114
// const points = userData.points || 0

0 commit comments

Comments
 (0)