Ainda vou aprimorar o código
Dentro da pasta prisma
, criar uma pasta chamada schemas.
No schemas, você pode criar seus modelos separados.
dentro do package.json
"scripts": {
import { useState, useEffect, useCallback, MouseEvent, TouchEvent } from 'react' | |
import * as S from './styles' | |
export default function DraggableBottomSheet({ isOpen }: { isOpen: boolean }) { | |
const [open, setIsOpen] = useState(isOpen) | |
const [isAnimating, setIsAnimating] = useState(false) // Controle da animação | |
const [isDragging, setIsDragging] = useState(false) | |
const [startY, setStartY] = useState(0) | |
const [translateY, setTranslateY] = useState(0) | |
const [shouldClose, setShouldClose] = useState(false) |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
<style> | |
html, | |
body { |
import { Route, Redirect } from 'react-router-dom'; | |
function App() { | |
const isAuthenticated = true; // Replace with actual authentication check | |
return ( | |
<Router> | |
<Switch> | |
<Route exact path="/" component={HomePage} /> | |
<Route exact path="/about" component={AboutPage} /> | |
<Route exact path="/contact" component={ContactPage} /> |
// package com.mypackage.service.orders.app.persistence; | |
// import org.springframework.beans.factory.annotation.Qualifier; | |
// import org.springframework.boot.autoconfigure.domain.EntityScan; | |
// import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties; | |
// import org.springframework.boot.jdbc.DataSourceBuilder; | |
// import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; | |
// import org.springframework.context.annotation.Bean; | |
// import org.springframework.context.annotation.Configuration; | |
// import org.springframework.context.annotation.Primary; |
/** | |
* Converter for converting a string CodeValue on the DTO into a Code object with type ITEM_TYPE_CODE | |
*/ | |
Converter<String, Code> itemTypeCodeConverter = new Converter<String, Code>() { | |
public Code convert(MappingContext<String, Code> context) { | |
Code itemTypeCode = null; | |
for (Code code : ModelMapperExampleApplication.storedCodes) { | |
if (code.getCodeType().equals(ModelMapperExampleApplication.ITEM_TYPE_CODE) | |
&& code.getCodeValue().equals(context.getSource())) { | |
itemTypeCode = code; |
/* eslint-disable @typescript-eslint/no-var-requires */ | |
const fs = require('fs') | |
const path = require('path') | |
const generateEnvFile = config => { | |
const envContent = Object.entries(config) | |
.map(([key, value]) => `${key}=${value}`) | |
.join('\n') | |
return envContent |
// Implementation | |
export class UserRepository extends PrismaRepository<'user'> {} | |
import { PrismaClient } from '@prisma/client'; | |
import { PrismaService } from '../integrations/prismaService'; | |
export class PrismaRepository< | |
K extends Exclude<keyof PrismaClient, symbol | `$${string}`>, | |
> { |
/** | |
* Stop an iframe or HTML5 <video> from playing | |
* @param {Element} element The element that contains the video | |
*/ | |
var stopVideo = function ( element ) { | |
var iframe = element.querySelector( 'iframe'); | |
var video = element.querySelector( 'video' ); | |
if ( iframe ) { | |
var iframeSrc = iframe.src; | |
iframe.src = iframeSrc; |
interface RequestOptions { | |
baseUrl?: string | |
prefix?: string | |
endpoint: string | |
config?: RequestInit | |
} | |
export async function request<T, TError>({ | |
...props | |
}: RequestOptions): Promise<{ |