chore: Remove unused code and dependencies

This commit is contained in:
mauro-balades
2024-08-27 15:57:55 +02:00
parent 8badee4776
commit b6a64a0f52
4 changed files with 7435 additions and 184 deletions

View File

@@ -1,6 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
//output: 'export',
images: {
remotePatterns: [
{

7584
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
"use client";
import { addDownload } from "@/lib/db";
import { useState, useEffect } from "react";
import styled, { keyframes } from "styled-components";
import { ny } from "@/lib/utils";
@@ -158,7 +157,6 @@ export default function DownloadPage() {
window.location.replace(`${BASE_URL}/${releases[releaseTarget]}`);
}
setHasDownloaded(true);
addDownload(releaseTarget);
throwConfetti();
};

View File

@@ -1,31 +0,0 @@
"use server";
import { createClient } from '@supabase/supabase-js'
const supabaseUrl = 'https://dmthyedfjzcysoekmyns.supabase.co'
const supabaseKey = process.env.SUPABASE_KEY as string;
const supabase = createClient(supabaseUrl, supabaseKey);
export async function addDownload(platform: string) {
// Check if the download count for the platform exists
const { data, error } = await supabase
.from('downloads')
.select('count')
.eq('platform', platform)
// If it doesn't exist, create it
console.log(data)
if (data?.length === 0 || data === null) {
const {data, error} = await supabase
.from('downloads')
.insert([{ platform, count: 1 }]);
if (error) {
console.error(error)
}
} else {
// If it exists, increment the count
await supabase
.from('downloads')
.update({ count: data![0].count + 1 })
.eq('platform', platform)
}
}