Commit d74581e6 authored by Fernando Luiz Elger's avatar Fernando Luiz Elger
Browse files

Merge branch 'feat/modal-importar-arquivos' into 'develop'

Criar modal de arquivo

See merge request !39
parents 6123e678 6c3b711f
Showing with 210 additions and 31 deletions
+210 -31
......@@ -41,6 +41,9 @@ dependencies:
autoprefixer:
specifier: 10.4.15
version: 10.4.15(postcss@8.4.28)
axios:
specifier: ^1.6.0
version: 1.6.1
class-variance-authority:
specifier: ^0.7.0
version: 0.7.0
......@@ -80,6 +83,9 @@ dependencies:
react-router-dom:
specifier: ^6.16.0
version: 6.17.0(react-dom@18.2.0)(react@18.2.0)
socket.io-client:
specifier: ^4.7.2
version: 4.7.2
tailwind-merge:
specifier: ^1.14.0
version: 1.14.0
......@@ -1260,6 +1266,10 @@ packages:
resolution: {integrity: sha512-0xd7qez0AQ+MbHatZTlI1gu5vkG8r7MYRUJAHPAHJBmGLs16zpkrpAVLvjQKQOqaXPDUBwOiJzNc00znHSCVBw==}
dev: false
/@socket.io/component-emitter@3.1.0:
resolution: {integrity: sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==}
dev: false
/@swc/helpers@0.5.1:
resolution: {integrity: sha512-sJ902EfIzn1Fa+qYmjdQqh8tPsoxyBz+8yBKC2HKUxyezKJFwPGOn7pv4WY6QuQW//ySQi5lJjA/ZT9sNWWNTg==}
dependencies:
......@@ -1488,6 +1498,10 @@ packages:
has-symbols: 1.0.3
dev: false
/asynckit@0.4.0:
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
dev: false
/autoprefixer@10.4.15(postcss@8.4.28):
resolution: {integrity: sha512-KCuPB8ZCIqFdA4HwKXsvz7j6gvSDNhDP7WnUjBleRkKjPdvCmHFuQ77ocavI8FT6NdvlBnE2UFr2H4Mycn8Vew==}
engines: {node: ^10 || ^12 || >=14}
......@@ -1514,6 +1528,16 @@ packages:
engines: {node: '>=4'}
dev: false
/axios@1.6.1:
resolution: {integrity: sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==}
dependencies:
follow-redirects: 1.15.3
form-data: 4.0.0
proxy-from-env: 1.1.0
transitivePeerDependencies:
- debug
dev: false
/axobject-query@3.2.1:
resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==}
dependencies:
......@@ -1645,6 +1669,13 @@ packages:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
dev: false
/combined-stream@1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
dependencies:
delayed-stream: 1.0.0
dev: false
/command-score@0.1.2:
resolution: {integrity: sha512-VtDvQpIJBvBatnONUsPzXYFVKQQAhuf3XTNOAsdBxCNO/QCtUUd8LSgjn0GVarBkCad6aJCZfXgrjYbl/KRr7w==}
dev: false
......@@ -1722,6 +1753,11 @@ packages:
object-keys: 1.1.1
dev: false
/delayed-stream@1.0.0:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
dev: false
/dequal@2.0.3:
resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
engines: {node: '>=6'}
......@@ -1777,6 +1813,25 @@ packages:
resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}
dev: false
/engine.io-client@6.5.3:
resolution: {integrity: sha512-9Z0qLB0NIisTRt1DZ/8U2k12RJn8yls/nXMZLn+/N8hANT3TcYjKFKcwbw5zFQiN4NTde3TSY9zb79e1ij6j9Q==}
dependencies:
'@socket.io/component-emitter': 3.1.0
debug: 4.3.4
engine.io-parser: 5.2.1
ws: 8.11.0
xmlhttprequest-ssl: 2.0.0
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
dev: false
/engine.io-parser@5.2.1:
resolution: {integrity: sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==}
engines: {node: '>=10.0.0'}
dev: false
/enhanced-resolve@5.15.0:
resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==}
engines: {node: '>=10.13.0'}
......@@ -2221,12 +2276,31 @@ packages:
resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==}
dev: false
/follow-redirects@1.15.3:
resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==}
engines: {node: '>=4.0'}
peerDependencies:
debug: '*'
peerDependenciesMeta:
debug:
optional: true
dev: false
/for-each@0.3.3:
resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
dependencies:
is-callable: 1.2.7
dev: false
/form-data@4.0.0:
resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
engines: {node: '>= 6'}
dependencies:
asynckit: 0.4.0
combined-stream: 1.0.8
mime-types: 2.1.35
dev: false
/fraction.js@4.3.6:
resolution: {integrity: sha512-n2aZ9tNfYDwaHhvFTkhFErqOMIb8uyzSQ+vGJBjZyanAKZVbGUQ1sngfk9FdkBw7G26O7AgNjLcecLffD1c7eg==}
dev: false
......@@ -2771,6 +2845,18 @@ packages:
picomatch: 2.3.1
dev: false
/mime-db@1.52.0:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
dev: false
/mime-types@2.1.35:
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'}
dependencies:
mime-db: 1.52.0
dev: false
/minimatch@3.1.2:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
dependencies:
......@@ -3107,6 +3193,10 @@ packages:
react-is: 16.13.1
dev: false
/proxy-from-env@1.1.0:
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
dev: false
/punycode@2.3.0:
resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
engines: {node: '>=6'}
......@@ -3381,6 +3471,30 @@ packages:
engines: {node: '>=8'}
dev: false
/socket.io-client@4.7.2:
resolution: {integrity: sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w==}
engines: {node: '>=10.0.0'}
dependencies:
'@socket.io/component-emitter': 3.1.0
debug: 4.3.4
engine.io-client: 6.5.3
socket.io-parser: 4.2.4
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
dev: false
/socket.io-parser@4.2.4:
resolution: {integrity: sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==}
engines: {node: '>=10.0.0'}
dependencies:
'@socket.io/component-emitter': 3.1.0
debug: 4.3.4
transitivePeerDependencies:
- supports-color
dev: false
/source-map-js@1.0.2:
resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
engines: {node: '>=0.10.0'}
......@@ -3771,6 +3885,24 @@ packages:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
dev: false
/ws@8.11.0:
resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: ^5.0.2
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
dev: false
/xmlhttprequest-ssl@2.0.0:
resolution: {integrity: sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==}
engines: {node: '>=0.4.0'}
dev: false
/yallist@4.0.0:
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
dev: false
......
export const AvatarByName = ({name}) => {
let color;
const words = name.split(' ');
const initials = words.map(word => word.charAt(0)).slice(0, 2).join('');
const letters = initials.toLowerCase()
export const AvatarByName = ({ name }) => {
let color;
const words = name?.split(' ');
const initials = words?.map(word => word.charAt(0)).slice(0, 2).join('');
const letters = initials?.toLowerCase()
const setValue = (letters) => {
const asciiValue = letters.charCodeAt(0) - 97;
const asciiValue2 = letters.charCodeAt(1) - 97;
const asciiValue = letters?.charCodeAt(0) - 97;
const asciiValue2 = letters?.charCodeAt(1) - 97;
const weightedSum = asciiValue * 2 + asciiValue2;
const values = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
const range = (25 * 2 + 25) / values.length;
const valueIndex = Math.min(values.length - 1, Math.floor(weightedSum / range));
return values[valueIndex];
}
......@@ -58,12 +58,11 @@ export const AvatarByName = ({name}) => {
color = 'bg-[#87FF87]';
}
return(
return (
<div className={`${color} relative align-middle border-none w-[38px] h-[38px] rounded-full py-2`}>
<div className="text-[15px] font-medium text-center text-backgroundDark">
{initials}
{initials}
</div>
</div>
)
}
\ No newline at end of file
import { Button } from "@/components/ui/button"
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog"
import { FileArchive } from 'lucide-react';
import { Input } from "@/components/ui/input"
export function ImportFilesDialog() {
return (
<Dialog>
<DialogTrigger asChild>
<Button className='text-background'>
<FileArchive className="flex mr-2 h-4 w-4" />Importe um arquivo
</Button>
</DialogTrigger>
<DialogContent className="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Importe um arquivo</DialogTitle>
</DialogHeader>
<div className="grid gap-4 pt-4">
<div className="grid grid-cols-4 items-center gap-4">
<Input
placeholder="Importar Arquivos"
type="file"
id="file"
className="w-fit"
accept=".docs, .pdf, .jpeg, .png"
/>
</div>
</div>
<DialogDescription>
{"Selecione um arquivo com extensão '.docs, .pdf, .jpeg, .png'"}
</DialogDescription>
<DialogFooter>
<Button variant='outline' className='bg-white text-black'>Cancel</Button>
<Button type="submit">Enviar</Button>
</DialogFooter>
</DialogContent>
</Dialog>
)
}
......@@ -12,6 +12,7 @@ import { Button } from "@/components/ui/button"
import { buttonVariants } from "@/components/ui/button"
import { ModalDuvida } from "../Duvida/Duvida"
import { ModalRoleta1 } from "../ModalRoleta/Roleta1"
import { ImportFilesDialog } from "../ImportFiles/ImportFilesDialog"
export function InteractiveButtonsCard() {
return (
......@@ -21,9 +22,9 @@ export function InteractiveButtonsCard() {
</CardHeader>
<CardContent className="space-y flex py-1 flex-wrap justify-first space-x-2">
<ModalDuvida />
<ModalCriarEnquete />
<ModalRoleta1/>
<ImportFilesDialog />
</CardContent>
</Card>
)
......
......@@ -10,10 +10,10 @@ import {
import Link from "next/link";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip"
import { Label } from "../ui/label";
......@@ -22,7 +22,7 @@ import { useRouter } from "next/navigation";
import { useState } from 'react'
import SetAvatar from "../SetAvatar/SetAvatar";
export default function RoomCard({name, description, participants, id}){
export default function RoomCard({ name, description, participants, id }) {
const router = useRouter();
......@@ -57,34 +57,34 @@ export default function RoomCard({name, description, participants, id}){
{name}
<div onClick={handleButtonClick}>
<EditRoom
defaultFormValues={defaultFormValues}
formValues={formValues}
setFormValues={setFormValues}
setOpen={setOpen}
open={open}
<EditRoom
defaultFormValues={defaultFormValues}
formValues={formValues}
setFormValues={setFormValues}
setOpen={setOpen}
open={open}
id={id}
/>
</div>
</CardTitle>
<CardDescription className="text-tertiary pt-2">
{description.length > 200 ?
{description?.length > 200 ?
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Label>{`${description.substring(0,200)}...`} <br/> {"(...)"}</Label>
<Label>{`${description.substring(0, 200)}...`} <br /> {"(...)"}</Label>
</TooltipTrigger>
<TooltipContent className="w-[400px] relative top-18 ">
{description}
</TooltipContent>
</Tooltip>
</TooltipProvider>
: description}
: description}
</CardDescription>
</CardHeader>
<CardFooter className="justify-end lg:grid xl:flex">
<SetAvatar participants={participants}/>
<SetAvatar participants={participants} />
</CardFooter>
</Card>
</Link>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment