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

Feature/hubben rat #102

Closed
wants to merge 6 commits into from
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
.vscode/*
target
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
context: frontend
dockerfile: dev.Dockerfile
environment:
BACKEND_ADDRESS: http://hubbit-backend:8080
BACKEND_ADDRESS: "http://hubbit-backend:8080"
ports:
- ${FRONTEND_PORT}:3000
volumes:
Expand Down
17 changes: 15 additions & 2 deletions frontend/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,27 @@
return <Error />;
}

const addRatIfNoSessions = (sessions: CurrentSessionFragment[]) => {
if (sessions.length === 0) {
return [
{
user: { cid: 'simongre', nick: 'Hubbenråttan', groups: [{ name: 'ratIT', prettyName: '🐀' }]},

Check failure on line 98 in frontend/src/pages/index.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `·`

Check failure on line 98 in frontend/src/pages/index.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `·`
startTime: new Date().toISOString(),
id: 'rat',
},
];
};

Check failure on line 103 in frontend/src/pages/index.tsx

View workflow job for this annotation

GitHub Actions / Lint

Delete `;`

Check failure on line 103 in frontend/src/pages/index.tsx

View workflow job for this annotation

GitHub Actions / Lint

Delete `;`
return sessions;
};

return (
<>
<Head>
<title>{createTitle('Who is in the Hubb?')}</title>
</Head>
<div className={styles.sessionsContainer}>
<ActiveUserList sessions={sessions} loggedInUser={data.me.cid} />
<ActiveGroupList sessions={sessions} />
<ActiveUserList sessions={addRatIfNoSessions(sessions)} loggedInUser={data.me.cid} />
<ActiveGroupList sessions={addRatIfNoSessions(sessions)} />
</div>
</>
);
Expand Down
Loading