Skip to content

Commit

Permalink
feat: Add ProfileView component and story
Browse files Browse the repository at this point in the history
  • Loading branch information
drikusroor committed Jun 28, 2024
1 parent 51f21de commit 493097d
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions frontend/src/stories/ProfileView.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { BrowserRouter as Router } from "react-router-dom";

import { ProfileView } from "../components/Profile/Profile";

export default {
title: "ProfileView",
component: ProfileView,
parameters: {
layout: "fullscreen",
},
};

function getProfileData(overrides = {}) {
return {
messages: {
title: "Profile",
summary: "Knorrum bipsum sulfur bit dalmatian",
},
scores: [
{
finished_at: "2021-09-20T12:00:00Z",
rank: {
class: "silver",
text: "2nd",
},
score: 100,
points: "points",
date: "2021-09-20",
experiment_slug: "experiment-slug",
},
{
finished_at: "2021-09-21T12:00:00Z",
rank: {
class: "bronze",
text: "3rd",
},
score: 50,
points: "points",
date: "2021-09-21",
experiment_slug: "experiment-slug",
},
],
...overrides,
};
}


const getDecorator = (Story) => (
<div
style={{ width: "100%", height: "100%", backgroundColor: "#aaa", padding: "1rem" }}
>
<Router>
<Story />
</Router>
</div>
);

export const Default = {
args: getProfileData(),
decorators: [getDecorator],
};

0 comments on commit 493097d

Please sign in to comment.