-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from localhost-8000/dev
Added PWA manifest and updated post tag options.
- Loading branch information
Showing
8 changed files
with
4,485 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,59 @@ | ||
import { College } from "~/utils/CollegeData"; | ||
import { College } from '~/utils/CollegeData'; | ||
|
||
export type PostStatus = "approved" | "rejected" | "pending"; | ||
export type PostStatus = 'approved' | 'rejected' | 'pending'; | ||
|
||
export type PendingPostAttr = { | ||
statusId: string; | ||
status: PostStatus; | ||
} | ||
statusId: string; | ||
status: PostStatus; | ||
}; | ||
|
||
export type Post = { | ||
id?: string; | ||
collegeData: College | null; | ||
confession: string; | ||
likesCount: number; | ||
likes?: { [key: string]: boolean }; | ||
createdAt?: string; | ||
reportCounts?: number; | ||
commentsCount?: number; | ||
isAdmin?: boolean; | ||
tags?: Tag[]; | ||
} | ||
id?: string; | ||
collegeData: College | null; | ||
confession: string; | ||
likesCount: number; | ||
likes?: { [key: string]: boolean }; | ||
createdAt?: string; | ||
reportCounts?: number; | ||
commentsCount?: number; | ||
isAdmin?: boolean; | ||
tags?: Tag[]; | ||
}; | ||
|
||
export type PostWithStatus = Post & PendingPostAttr; | ||
|
||
export type TextModerationResult = { | ||
"hate": boolean; | ||
"hate/threatening": boolean; | ||
"self-harm": false, | ||
"sexual": false, | ||
"sexual/minors": false, | ||
"violence": false, | ||
"violence/graphic": false | ||
} | ||
hate: boolean; | ||
'hate/threatening': boolean; | ||
'self-harm': false; | ||
sexual: false; | ||
'sexual/minors': false; | ||
violence: false; | ||
'violence/graphic': false; | ||
}; | ||
|
||
export type TextModerationReturnType = { | ||
isViolatingContent: boolean; | ||
message: string | undefined; | ||
error?: boolean; | ||
} | ||
isViolatingContent: boolean; | ||
message: string | undefined; | ||
error?: boolean; | ||
}; | ||
|
||
export type PostComment = { | ||
id?: string; | ||
comment: string; | ||
authorName: string; | ||
authorPhotoUrl: string; | ||
createdAt: string; | ||
} | ||
|
||
export type Tag = "college" | "confession" | "farewell" | "farewell2023" | "friendship" | "love" | "shayari"; | ||
id?: string; | ||
comment: string; | ||
authorName: string; | ||
authorPhotoUrl: string; | ||
createdAt: string; | ||
}; | ||
|
||
export type Tag = | ||
| 'college' | ||
| 'confession' | ||
| 'farewell' | ||
| 'farewell2023' | ||
| 'friendship' | ||
| 'love' | ||
| 'shayari' | ||
| 'breakup' | ||
| 'cutie' | ||
| 'soulmate'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,44 @@ | ||
import { defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
import { defineConfig } from 'vite'; | ||
import { VitePWA, VitePWAOptions } from 'vite-plugin-pwa'; | ||
import react from '@vitejs/plugin-react'; | ||
import tsconfigPaths from 'vite-tsconfig-paths'; | ||
|
||
const manifestForPlugin: Partial<VitePWAOptions> = { | ||
registerType: 'prompt', | ||
includeAssets: ['confess-me-logo.png'], | ||
manifest: { | ||
name: 'Secret confession application', | ||
short_name: 'secret confession', | ||
description: | ||
'Share your secret crush or love anonymously on Secret Confession, the safe and supportive platform for sharing your deepest feelings.', | ||
icons: [ | ||
{ | ||
src: './assets/confess-me-logo.png', | ||
sizes: '192x192', | ||
type: 'image/png', | ||
}, | ||
{ | ||
src: './assets/confess-me-logo.png', | ||
sizes: '512x512', | ||
type: 'image/png', | ||
}, | ||
{ | ||
src: './assets/confess-me-logo.png', | ||
sizes: '225x225', | ||
type: 'image/png', | ||
purpose: 'any maskable', | ||
}, | ||
], | ||
orientation: 'portrait', | ||
display: 'standalone', | ||
scope: '/', | ||
start_url: '/', | ||
theme_color: '#333346', | ||
background_color: '#6d6d86', | ||
}, | ||
}; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react(), tsconfigPaths()] | ||
}) | ||
plugins: [react(), tsconfigPaths(), VitePWA(manifestForPlugin)], | ||
}); |
Oops, something went wrong.