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
# Dockerfile | |
FROM node:18-alpine AS dependencies | |
RUN apk add --no-cache libc6-compat | |
WORKDIR /home/app | |
# install dependencies | |
COPY package.json ./ | |
COPY package-lock.json ./ | |
RUN npm i |
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
// next.config.js | |
/** @type {import('next').NextConfig} */ | |
const nextConfig = { | |
reactStrictMode: true, | |
output: "standalone" | |
}; | |
module.exports = nextConfig; |
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
// pages/add.js | |
export default function Add() { | |
const storeAddTask = useGlobalStore((state) => state.addTask); | |
const handleSubmit = () => { | |
storeAddTask({ | |
title: title, | |
description: description, |
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
// components/Task.js | |
export default function Task(props) { | |
// ... | |
<CardActions> | |
{props.isDone ? ( | |
<Button size="small" onClick={() => props.markTaskAsUndone(props.id)}>Mark as undone</Button> | |
) : ( | |
<Button size="small" onClick={() => props.markTaskAsDone(props.id)}>Mark as done</Button> | |
)} |
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
// pages/index.js | |
export default function Home() { | |
const storeTasks = useGlobalStore((state) => state.tasks); | |
const storeDeleteTask = useGlobalStore((state) => state.deleteTask); | |
const storeClearTasks = useGlobalStore((state) => state.clearTasks); | |
const storeMarkTaskAsDone = useGlobalStore((state) => state.markTaskAsDone); | |
const storeMarkTaskAsUndone = useGlobalStore((state) => state.markTaskAsUndone); |
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
// store/storage.js | |
import {create} from "zustand"; | |
import {persist} from "zustand/middleware"; | |
const useGlobalStore = create( | |
persist( | |
(set, get) => ({ | |
tasks: [], | |
addTask: (params) => { |
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
// pages/add.js | |
import * as React from "react"; | |
import {useState} from "react"; | |
import {Box, Container, FormControlLabel, FormGroup, Switch, TextField} from "@mui/material"; | |
import Typography from "@mui/material/Typography"; | |
import Button from "@mui/material/Button"; | |
import CardContent from "@mui/material/CardContent"; | |
import Card from "@mui/material/Card"; | |
import Link from "next/link"; |
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
// pages/index.js | |
import Card from "@mui/material/Card"; | |
import CardContent from "@mui/material/CardContent"; | |
import Button from "@mui/material/Button"; | |
import Typography from "@mui/material/Typography"; | |
import {Box, Container, Grid} from "@mui/material"; | |
import Task from "../components/Task"; | |
import * as React from "react"; | |
import {useEffect, useState} from "react"; |
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
// components/Task.js | |
import CardContent from "@mui/material/CardContent"; | |
import Typography from "@mui/material/Typography"; | |
import CardActions from "@mui/material/CardActions"; | |
import Button from "@mui/material/Button"; | |
import Card from "@mui/material/Card"; | |
export default function Task(props) { | |
return ( |
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
Kotlin | |
Incognia.setUserId(context, <userId>) | |
Java | |
Incognia.setUserId(context, <userId>); | |
Swift | |
ICGIncognia.setUserId(<userId>) | |
Objective-C |