mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
* shout comments * fix notifications * Remove whitespace for empty category sections * Overhaul post actions * Adjust spacing * Allow fine-grained size control for icons and circle buttons via css variables; adjust comments layout * Adjust spacing * Add test for ActionButton (WIP) * Rename import * Remove text and add count bubble * Use filled icons to indicate active states * Adjust sizes and orientation * Remove unused properties, add test * Fix ObserveButton test * Fix ShoutButton test * fix tests * Adapt styles * Adjust style for larger numbers * Remove unused icon * Fix test structure * Remove unused class names --------- Co-authored-by: Maximilian Harz <maxharz@gmail.com>
165 lines
2.3 KiB
JavaScript
165 lines
2.3 KiB
JavaScript
import gql from 'graphql-tag'
|
|
|
|
export const userFragment = gql`
|
|
fragment user on User {
|
|
id
|
|
slug
|
|
name
|
|
avatar {
|
|
url
|
|
}
|
|
disabled
|
|
deleted
|
|
}
|
|
`
|
|
|
|
export const locationFragment = (lang) => gql`
|
|
fragment location on User {
|
|
locationName
|
|
location {
|
|
id
|
|
name: name${lang}
|
|
lng
|
|
lat
|
|
distanceToMe
|
|
}
|
|
}
|
|
`
|
|
|
|
export const badgesFragment = gql`
|
|
fragment badges on User {
|
|
badgeTrophiesSelected {
|
|
id
|
|
icon
|
|
description
|
|
}
|
|
badgeVerification {
|
|
id
|
|
icon
|
|
description
|
|
}
|
|
}
|
|
`
|
|
|
|
export const userCountsFragment = gql`
|
|
fragment userCounts on User {
|
|
shoutedCount
|
|
contributionsCount
|
|
commentedCount
|
|
followedByCount
|
|
followingCount
|
|
followedByCurrentUser
|
|
}
|
|
`
|
|
|
|
export const userTeaserFragment = (lang) => gql`
|
|
${badgesFragment}
|
|
${locationFragment(lang)}
|
|
|
|
fragment userTeaser on User {
|
|
followedByCount
|
|
contributionsCount
|
|
commentedCount
|
|
...badges
|
|
...location
|
|
}
|
|
`
|
|
|
|
export const postFragment = gql`
|
|
fragment post on Post {
|
|
id
|
|
title
|
|
content
|
|
contentExcerpt
|
|
createdAt
|
|
updatedAt
|
|
disabled
|
|
deleted
|
|
slug
|
|
language
|
|
image {
|
|
url
|
|
sensitive
|
|
aspectRatio
|
|
type
|
|
}
|
|
author {
|
|
...user
|
|
}
|
|
pinnedAt
|
|
pinned
|
|
isObservedByMe
|
|
observingUsersCount
|
|
}
|
|
`
|
|
|
|
export const groupFragment = gql`
|
|
fragment group on Group {
|
|
id
|
|
groupName: name
|
|
slug
|
|
disabled
|
|
deleted
|
|
about
|
|
description
|
|
descriptionExcerpt
|
|
groupType
|
|
actionRadius
|
|
categories {
|
|
id
|
|
slug
|
|
name
|
|
icon
|
|
}
|
|
locationName
|
|
myRole
|
|
}
|
|
`
|
|
|
|
export const postCountsFragment = gql`
|
|
fragment postCounts on Post {
|
|
commentsCount
|
|
shoutedCount
|
|
shoutedByCurrentUser
|
|
emotionsCount
|
|
clickedCount
|
|
viewedTeaserCount
|
|
viewedTeaserByCurrentUser
|
|
}
|
|
`
|
|
|
|
export const tagsCategoriesAndPinnedFragment = gql`
|
|
fragment tagsCategoriesAndPinned on Post {
|
|
tags {
|
|
id
|
|
}
|
|
categories {
|
|
id
|
|
slug
|
|
name
|
|
icon
|
|
}
|
|
pinnedBy {
|
|
id
|
|
name
|
|
role
|
|
}
|
|
}
|
|
`
|
|
|
|
export const commentFragment = gql`
|
|
fragment comment on Comment {
|
|
id
|
|
createdAt
|
|
updatedAt
|
|
disabled
|
|
deleted
|
|
content
|
|
contentExcerpt
|
|
isPostObservedByMe
|
|
postObservingUsersCount
|
|
shoutedByCurrentUser
|
|
shoutedCount
|
|
}
|
|
`
|