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

Revert "Demo" #2

Merged
merged 1 commit into from
Apr 26, 2024
Merged
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
6 changes: 1 addition & 5 deletions client/apis/apiClient.posts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import request from 'superagent'
import { NewPost, Post } from '../../models/post'
import { Post } from '../../models/post'

const root = '/api/v1/posts'

@@ -12,7 +12,3 @@ export async function getSinglePost(id: number) {
const res = await request.get(`${root}/post/${id}`)
return res.body
}

export async function addPost(newPost: NewPost): Promise<void> {
await request.post(`${root}/post/`).send(newPost)
}
12 changes: 1 addition & 11 deletions client/apis/apiGroup.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
import request from 'superagent'
import { group, member } from '../../models/group'
import { group } from '../../models/group'

const rootUrl = '/api/v1/groups'

export async function getAllGroups(): Promise<group[]> {
const res = await request.get(rootUrl)
return res.body
}

export async function getGroupById(id: number): Promise<group> {
const res = await request.get(`${rootUrl}/${id}`)
return res.body
}

export async function getGroupMembersById(id: number): Promise<member[]> {
const res = await request.get(`${rootUrl}/members/${id}`)
return res.body
}
81 changes: 0 additions & 81 deletions client/components/AddPost.tsx

This file was deleted.

85 changes: 41 additions & 44 deletions client/components/AllGroups.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { getAllGroups } from '../apis/apiGroup'
import { useQuery } from '@tanstack/react-query'
import { Link } from 'react-router-dom'

export function AllGroups() {
const {
@@ -15,7 +14,7 @@ export function AllGroups() {
return <h1>Loading...GroupPage</h1>
}

if (isError || !groupsData) {
if (isError) {
return <h1>Error</h1>
}

@@ -24,51 +23,49 @@ export function AllGroups() {
<h1>All groups</h1>
<div className="p-24 flex flex-wrap items-center justify-center">
{groupsData.map((group) => (
<Link key={group.id} to={`/groups/${group.id}`}>
<div
key={group.id}
className="flex-shrink-0 m-6 relative overflow-hidden mt-auto bg-gradient-to-r from-gray-100 via-[#bce1ff] to-gray-1000 rounded-lg max-w-xs shadow-lg"
<div
key={group.id}
className="flex-shrink-0 m-6 relative overflow-hidden mt-auto bg-gradient-to-r from-gray-100 via-[#bce1ff] to-gray-1000 rounded-lg max-w-xs shadow-lg"
>
<svg
className="absolute bottom-0 left-0 mb-8 "
viewBox="0 0 375 283"
fill="none"
>
<svg
className="absolute bottom-0 left-0 mb-8 "
viewBox="0 0 375 283"
fill="none"
>
<rect
x="159.52"
y="175"
width="152"
height="152"
rx="8"
transform="rotate(-45 159.52 175)"
fill="white"
/>
<rect
y="107.48"
width="152"
height="152"
rx="8"
transform="rotate(-45 0 107.48)"
fill="white"
/>
</svg>
<div className="relative pt-10 px-10 flex items-center justify-center">
<div className="block absolute w-48 h-48 bottom-0 left-0 -mb-24 ml-3"></div>
<img
className="relative w-40"
src={`/images/icons/${group.image}`}
alt={group.name}
/>
</div>
<div className="relative text-black px-6 pb-6 mt-6">
<div className="flex justify-between">
<span className="block font-semibold text-xl">
{group.name}
</span>
</div>
<rect
x="159.52"
y="175"
width="152"
height="152"
rx="8"
transform="rotate(-45 159.52 175)"
fill="white"
/>
<rect
y="107.48"
width="152"
height="152"
rx="8"
transform="rotate(-45 0 107.48)"
fill="white"
/>
</svg>
<div className="relative pt-10 px-10 flex items-center justify-center">
<div className="block absolute w-48 h-48 bottom-0 left-0 -mb-24 ml-3"></div>
<img
className="relative w-40"
src={`/images/icons/${group.image}`}
alt={group.name}
/>
</div>
<div className="relative text-black px-6 pb-6 mt-6">
<div className="flex justify-between">
<span className="block font-semibold text-xl">
{group.name}
</span>
</div>
</div>
</Link>
</div>
))}
</div>
</>
58 changes: 0 additions & 58 deletions client/components/GroupMemberList.tsx

This file was deleted.

78 changes: 0 additions & 78 deletions client/components/GroupProfilePage.tsx

This file was deleted.

Loading

Unchanged files with check annotations Beta

describe('<News/>', () => {
it('should show a loading indicator', async () => {
const scope = nock('http://localhost')

Check warning on line 31 in client/components/__tests__/News.test.tsx

GitHub Actions / tests

'scope' is assigned a value but never used
.get(`/api/v1/external`)
.reply(200, mockNews)