mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-05 07:24:28 +01:00
initial commit
This commit is contained in:
32
src/api/index.ts
Normal file
32
src/api/index.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Project, ProjectCard, ProjectCategory } from "../utils/interfaces";
|
||||
import data from "./mockData.json";
|
||||
|
||||
export async function getAllCategories(): Promise<ProjectCategory[]> {
|
||||
return data.categories;
|
||||
}
|
||||
|
||||
export async function getHottestProjects(): Promise<ProjectCard[]> {
|
||||
return data.projectsCards;
|
||||
}
|
||||
|
||||
export async function getProjectsByCategory(
|
||||
categoryId: string
|
||||
): Promise<ProjectCard[]> {
|
||||
return data.projectsCards;
|
||||
}
|
||||
|
||||
// returns the latest bunch of projects in each ( or some ) categories, and returns the hottest projects
|
||||
export async function getLatestProjects(): Promise<
|
||||
{ title: string; projects: ProjectCard[] }[]
|
||||
> {
|
||||
return [{ title: "hottest_apps", projects: data.projectsCards }].concat(
|
||||
data.categories.slice(0, 2).map((cat) => ({
|
||||
title: cat.title,
|
||||
projects: data.projectsCards,
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
export async function getProjectById(projectId: string): Promise<Project> {
|
||||
return data.project;
|
||||
}
|
||||
131
src/api/mockData.json
Normal file
131
src/api/mockData.json
Normal file
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"categories": [
|
||||
{
|
||||
"id": "123",
|
||||
"title": "Art & Collectibles"
|
||||
},
|
||||
{
|
||||
"id": "124",
|
||||
"title": "DeFi"
|
||||
},
|
||||
{
|
||||
"id": "311",
|
||||
"title": "Entertainment"
|
||||
},
|
||||
{
|
||||
"id": "333",
|
||||
"title": "Exchange"
|
||||
},
|
||||
{
|
||||
"id": "223",
|
||||
"title": "News"
|
||||
},
|
||||
{
|
||||
"id": "451",
|
||||
"title": "Shop"
|
||||
},
|
||||
{
|
||||
"id": "2321",
|
||||
"title": "Social"
|
||||
},
|
||||
{
|
||||
"id": "51231",
|
||||
"title": "Wallet"
|
||||
},
|
||||
{
|
||||
"id": "1321",
|
||||
"title": "Other"
|
||||
}
|
||||
],
|
||||
"projectsCards": [
|
||||
{
|
||||
"id": "123123",
|
||||
"title": "First App",
|
||||
"img": "https://via.placeholder.com/150",
|
||||
"category": {
|
||||
"id": "51231",
|
||||
"title": "{app.category}"
|
||||
},
|
||||
"votes_count": 123
|
||||
},
|
||||
{
|
||||
"id": "765454",
|
||||
"title": "Second App",
|
||||
"img": "https://via.placeholder.com/150",
|
||||
"category": {
|
||||
"id": "51231",
|
||||
"title": "{app.category}"
|
||||
},
|
||||
"votes_count": 123
|
||||
},
|
||||
{
|
||||
"id": "2111134",
|
||||
"title": "Third App",
|
||||
"img": "https://via.placeholder.com/150",
|
||||
"category": {
|
||||
"id": "51231",
|
||||
"title": "{app.category}"
|
||||
},
|
||||
"votes_count": 123
|
||||
},
|
||||
{
|
||||
"id": "12344123",
|
||||
"title": "Fourth App",
|
||||
"img": "https://via.placeholder.com/150",
|
||||
"category": {
|
||||
"id": "51231",
|
||||
"title": "{app.category}"
|
||||
},
|
||||
"votes_count": 123
|
||||
},
|
||||
{
|
||||
"id": "56745",
|
||||
"title": "Fifth App",
|
||||
"img": "https://via.placeholder.com/150",
|
||||
"category": {
|
||||
"id": "51231",
|
||||
"title": "{app.category}"
|
||||
},
|
||||
"votes_count": 123
|
||||
},
|
||||
{
|
||||
"id": "3312431",
|
||||
"title": "Sixth App",
|
||||
"img": "https://via.placeholder.com/150",
|
||||
"category": {
|
||||
"id": "51231",
|
||||
"title": "{app.category}"
|
||||
},
|
||||
"votes_count": 123
|
||||
}
|
||||
],
|
||||
"project": {
|
||||
"id": "123123123",
|
||||
"cover_image": "https://s3-alpha-sig.figma.com/img/07b8/5d84/145942255afd215b3da26dbbf1dd03bd?Expires=1638144000&Signature=Cl1DUQJIUsrrFi48M~qU1r3Z0agGdy-uiNUao5g8-nu34QtoyWTFPXvaH3naSZBYqcPyKFq1jaXF6Mw1uj1hdWwGhXhMPLnKNJFFrGViVXhXu-3YeCPY9p4-IcieFJBZPVA~zDY8zxY5b06loWsINAVx4eMHRAhSWl~~Mca5PjlSXloiYrT00W-6c9m8gevfMMX~PsHQedzwYzg0j2DlnhPX8LbRkli1G2OxtCaFwo3~HGHXIlFGuGU1uXRvi1qBWrdjdsuWgIly1ekcFfJWAKmwYXk06EtCmfWRgGYbD7cBK~lwOkFofbf1LW0yqLv0hr4svwToH~3FiHenrCF-1g__&Key-Pair-Id=APKAINTVSUGEWH5XD5UA",
|
||||
"thumbnail_image": "https://s3-alpha-sig.figma.com/img/be1b/cd75/1baa911b3875134c0889d6755c4ba2cb?Expires=1637539200&Signature=QExmgJCGGSES~zIwM-2G8yd7aPR-j5eFnV3tOg6BkSdXVB9AMhHQPbRpbfOv~rD3hdMdSPMkS9kfjyFbAuonltV2zrf5GOwGxrF2GVdhpIGc6RiqGLWVVY8mXysEm6~0fVj~2SK8hec~YnV1h0oHDQiZF5YjGi143pImGmcVERPpB7MiksSoD0Vki6RXamySopj~f-~lUGy2uKRbQKxQ4LCFTz-H9O8vpkZpCVq274FYsqsEtUihwVjniNXV8ukLxdL~rfgf8L9MeiR7gDYYQ9MSLMZKEa~TnQ-JadlngQz78a2T801WaG2xp5hGHYQMtIi1ES-N4FOg5PwEjtIetA__&Key-Pair-Id=APKAINTVSUGEWH5XD5UA",
|
||||
"title": "Project Name",
|
||||
"website": "www.project.com",
|
||||
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio nobis aliquam, minima assumenda earum sapiente pariatur cupiditate error nihil, eius corporis ratione unde perspiciatis tenetur ipsa aut ex consequatur maiores eligendi quidem exercitationem suscipit. Ex hic reprehenderit deleniti possimus culpa animi velit? Dolores, nemo quis minima sapiente sed laborum ipsam?",
|
||||
"tags": [
|
||||
{
|
||||
"id": "123",
|
||||
"title": "lightning"
|
||||
},
|
||||
{
|
||||
"id": "333",
|
||||
"title": "payments"
|
||||
},
|
||||
{
|
||||
"id": "444",
|
||||
"title": "lnurl-auth"
|
||||
}
|
||||
],
|
||||
"screenShots": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"votes_count": 4432
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user