refactor: renames, rewrite some file, function names and texts
This commit is contained in:
6
utils/cn.ts
Normal file
6
utils/cn.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { type ClassValue, clsx } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export const sayings = [
|
||||
export const getSayings = [
|
||||
'hot off the press',
|
||||
'straight from the oven',
|
||||
"straight from the horse's mouth",
|
||||
@@ -1,6 +0,0 @@
|
||||
import { type ClassValue, clsx } from "clsx"
|
||||
import { twMerge } from "tailwind-merge"
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
export const topNews = 'https://hacker-news.firebaseio.com/v0/topstories.json';
|
||||
export const getTopNews =
|
||||
'https://hacker-news.firebaseio.com/v0/topstories.json';
|
||||
|
||||
export function singleNews(id: number) {
|
||||
export function getSingleNews(id: number) {
|
||||
return `https://hacker-news.firebaseio.com/v0/item/${id}.json`;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const ResponseSchema = z.object({
|
||||
success: z.boolean(),
|
||||
message: z.string()
|
||||
});
|
||||
|
||||
export type ResponseType = z.infer<typeof ResponseSchema>;
|
||||
export interface ResponseType {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export const SubscribeFormSchema = z.object({
|
||||
email: z.string().email()
|
||||
@@ -36,24 +34,17 @@ export const NewsDatabaseSchema = z.object({
|
||||
|
||||
export type NewsDatabaseType = z.infer<typeof NewsDatabaseSchema>;
|
||||
|
||||
export const NewsSchema = z.object({
|
||||
id: z.number(),
|
||||
title: z.string(),
|
||||
text: z.string().nullable(),
|
||||
type: z.string(),
|
||||
by: z.string(),
|
||||
time: z.number(),
|
||||
url: z.string().nullable(),
|
||||
score: z.number(),
|
||||
createdAt: z.date()
|
||||
});
|
||||
export interface NewsTileType {
|
||||
id: number;
|
||||
title: string;
|
||||
by: string;
|
||||
}
|
||||
|
||||
export type NewsType = z.infer<typeof NewsSchema>;
|
||||
|
||||
export const NewsTileSchema = z.object({
|
||||
id: z.number(),
|
||||
title: z.string(),
|
||||
by: z.string()
|
||||
});
|
||||
|
||||
export type NewsTileType = z.infer<typeof NewsTileSchema>;
|
||||
export interface NewsType extends NewsTileType {
|
||||
text: string | null;
|
||||
type: string;
|
||||
time: number;
|
||||
url: string | null;
|
||||
score: number;
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user