Skip to content

Commit

Permalink
Prototype: profile updates
Browse files Browse the repository at this point in the history
  • Loading branch information
augustinhiebel committed Dec 6, 2023
1 parent b8a8421 commit 11bc4cb
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 23 deletions.
20 changes: 20 additions & 0 deletions mock-data/data-games.js
Original file line number Diff line number Diff line change
Expand Up @@ -6924,6 +6924,26 @@ export const dataGames = [
},
},
],
demo: {
mainStats: [
{
label: "Win ratio %",
value: "57.2",
},
{
label: "KDA",
value: "7.3 / 6.4 / 8.2",
},
{
label: "CS/min",
value: "104",
},
{
label: "Vision score",
value: "71%",
},
],
},
},
{
id: 3,
Expand Down
2 changes: 1 addition & 1 deletion mock-data/data-users.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const dataUsers = [
powertokens: 105,
tickets: 3,
},
games: [1, 6, 4],
games: [1, 6, 4, 2],
ladders: [
{
gameSlug: "valorant",
Expand Down
8 changes: 4 additions & 4 deletions pages/stryda/components/FeedItemMatchTabSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function FeedItemMatchTabSummary(props) {
onClick={() => !detailedView && openFeedItemDetailsMatch("summary")}
>
<div
className={`relative z-40
className={`relative z-20
${match.stats.result === "victory" && "text-success-300"}
${match.stats.result === "defeat" && "text-error-300"}
${match.stats.result === "draw" && "text-ui-200"}
Expand All @@ -76,7 +76,7 @@ export default function FeedItemMatchTabSummary(props) {
{match.stats.score.team1} - {match.stats.score.team2}
</div>
</div>
<div className="relative z-40 text-base sm:text-xl md:text-2xl uppercase text-ui-100">
<div className="relative z-20 text-base sm:text-xl md:text-2xl uppercase text-ui-100">
<div className="flex gap-1.5 items-center">
<img
src={getGamemodeImage(match.meta.mode)}
Expand All @@ -87,7 +87,7 @@ export default function FeedItemMatchTabSummary(props) {
</div>
<div>{getMapByID(match.meta.map).name}</div>
</div>
<ul className="relative z-40 text-xl uppercase flex items-center justify-end text-left space-x-4 sm:space-x-6 md:space-x-8">
<ul className="relative z-20 text-xl uppercase flex items-center justify-end text-left space-x-4 sm:space-x-6 md:space-x-8">
{match.stats.mainStats
.slice(0, 3)
.map((mainStat, mainStatIndex) => (
Expand All @@ -105,7 +105,7 @@ export default function FeedItemMatchTabSummary(props) {
<Link href={`/stryda/valorant/stats${prototype.getURLparams()}`}>
<button
type="button"
className="relative z-40 button button-primary"
className="relative z-20 button button-primary"
onClick={uiContext.closeModal()}
>
<span>View match stats</span>
Expand Down
10 changes: 5 additions & 5 deletions pages/stryda/profile/[user_id]/tab-feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ export default function TabProfileFeed() {
{prototype.getUserFeedItems(selectedUser.id).length === 0 ||
isEmpty ? (
<>
<div className="p-4 text-center">
<div className="px-4 py-24 text-center">
<div className="max-w-xs mx-auto">
<span className="icon icon-sword text-6xl text-ui-500" />
{selectedUser.isYou ? (
<>
<div className="mt-2 mb-6">
<p className="text-sm text-ui-400">
You have no recorded matches
You have no recorded matches.
</p>
<p className="text-lg text-ui-300">
Make sure Stryda is up and running when you play
Expand All @@ -67,7 +67,7 @@ export default function TabProfileFeed() {
<div className="mt-2 mb-6">
<p className="text-lg text-ui-300">
{selectedUser.nickname} hasn&#39;t played any
matches
matches.
</p>
</div>
)}
Expand Down Expand Up @@ -98,7 +98,7 @@ export default function TabProfileFeed() {
</h2>
</Link>
</div>
{selectedUser.ladders.length === 0 || isEmpty ? (
{!selectedUser.ladders || selectedUser.ladders?.length === 0 || isEmpty ? (
<>
{selectedUser.isYou ? (
<div className="bg-ui-850 p-4">
Expand Down Expand Up @@ -140,7 +140,7 @@ export default function TabProfileFeed() {
<div className="text-center p-4">
<span className="icon icon-ladder text-6xl text-ui-500" />
<p className="mt-2 text-ui-300">
{selectedClan.nickname} has not entered any Ladders
{selectedUser.nickname} has not entered any Ladders.
</p>
</div>
)}
Expand Down
4 changes: 2 additions & 2 deletions pages/stryda/profile/[user_id]/tab-highlights.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ export default function TabProfileHighlights() {
<div className="mt-2">
<p className="text-ui-300">
{selectedUser.isYou ? (
<>You haven&#39;t created any Recaps yet</>
<>You haven&#39;t created any Recaps yet.</>
) : (
<>
{selectedUser.nickname} hasn&#39;t created any Recaps yet
{selectedUser.nickname} hasn&#39;t created any Recaps yet.
yet
</>
)}
Expand Down
24 changes: 13 additions & 11 deletions pages/stryda/profile/[user_id]/tab-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,20 @@ export default function TabProfileStats() {
<div className="relative z-10 flex items-center gap-2 mb-2">
<GameIcon game={item} />
<h6 className="flex-1">{prototype.getGameByID(item).name}</h6>
<Link
href={`/stryda/${
prototype.getGameByID(item).slug
}/stats${prototype.getURLparams()}`}
>
<button
type="button"
className="button button-sm button-secondary"
{item !== 2 && (
<Link
href={`/stryda/${
prototype.getGameByID(item).slug
}/stats${prototype.getURLparams()}`}
>
<span>See all stats & Matches</span>
</button>
</Link>
<button
type="button"
className="button button-sm button-secondary"
>
<span>See all stats & Matches</span>
</button>
</Link>
)}
</div>
<ul className="relative z-10 p-4 flex flex-wrap justify-evenly items-center bg-gradient-to-b from-ui-900/40 to-ui-900/20 text-center gap-4 rounded">
{prototype
Expand Down

0 comments on commit 11bc4cb

Please sign in to comment.