Skip to content

Commit

Permalink
updating width of containers
Browse files Browse the repository at this point in the history
  • Loading branch information
vmanawat committed Jun 18, 2024
1 parent b19d338 commit 72ac432
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 32 deletions.
8 changes: 4 additions & 4 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}

.custom-file-upload {
width: 1000px !important;
width: 1500px !important;
height: 200px !important;
padding-left: 20%;
}
Expand All @@ -37,8 +37,8 @@
position: relative;
display: flex;
align-items: center;
min-width: 400px;
max-width: 1000px;
min-width: 1200px;
max-width: 1500px;
border: 2px dashed rgb(6, 88, 194);
border-radius: 5px;
cursor: pointer;
Expand All @@ -52,7 +52,7 @@
}

.file-list, .file-drop-list{
width: 1000px;
width: 1200px;
align-items: center;
margin: auto;
}
Expand Down
41 changes: 13 additions & 28 deletions frontend/src/pages/FileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ import {
ListItem,
ListItemText,
Typography,
Modal,
CircularProgress,
Dialog,
DialogTitle,
DialogContent,
DialogActions,
} from '@mui/material'
import React, { useEffect, useState } from 'react'
import React, { useState } from 'react'
import { FileUploader } from 'react-drag-drop-files'
import {
DeleteRounded,
Expand All @@ -26,7 +25,6 @@ import {
Error,
ExpandMore,
ChevronRight,
Title,
} from '@mui/icons-material'
import '@/index.css'
import { jwtDecode } from 'jwt-decode'
Expand All @@ -35,20 +33,6 @@ import UserService from '@/service/user-service'

const fileTypes = ['xlsx', 'csv', 'txt']
let selectedFiles: any[] = []
const validate = false
const submit = false

const modalStyle = {
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: 400,
bgcolor: 'background.paper',
border: '2px solid #000',
boxShadow: 24,
p: 4,
}

function FileUpload() {
const [files, setFiles] = useState(null)
Expand All @@ -73,7 +57,6 @@ function FileUpload() {

checkedItems.items = selectedFiles.map((index) => true)
fileStatusCodes.items = selectedFiles.map((index) => null)

}

const deleteFile = (file: string | Blob) => {
Expand Down Expand Up @@ -152,22 +135,23 @@ function FileUpload() {
})
}

const handleCheckboxChange = (index: number) => (event: { target: { checked: any } }) => {
const newItems = [...checkedItems.items]
newItems[index] = event.target.checked
setCheckedItems({
master: newItems.every((item) => item),
items: newItems,
})
}
const handleCheckboxChange =
(index: number) => (event: { target: { checked: any } }) => {
const newItems = [...checkedItems.items]
newItems[index] = event.target.checked
setCheckedItems({
master: newItems.every((item) => item),
items: newItems,
})
}

const fileSizeError = () => {
confirm('File size error \n TODO')
}

return (
<div style={{ marginLeft: '4em', width: '100%' }}>
<Box sx={{ width: '100%' }}>
<Box sx={{ width: '1200px' }}>
<Typography variant="h3" component="h1" gutterBottom>
Electronic Data Transfer - Upload
</Typography>
Expand All @@ -176,6 +160,7 @@ function FileUpload() {
results.
</Typography>
</Box>

<div>
<FileUploader
classes="custom-file-upload"
Expand Down Expand Up @@ -250,7 +235,7 @@ function FileUpload() {

{expandList && (
<div className="file-list">
<List sx={{ maxHeight: 300, overflow: 'auto'}}>
<List sx={{ maxHeight: 300, overflow: 'auto' }}>
{selectedFiles.length > 0 && selectedFiles.length <= 10
? selectedFiles.map((file, index) => (
<ListItem key={index}>
Expand Down

0 comments on commit 72ac432

Please sign in to comment.