Mickey_03

Form code

Nov 2nd, 2021
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <form onSubmit={handleSubmit}>
  2.             <TextField
  3.               // Single song file Input
  4.               id="music-upload"
  5.               name="file"
  6.               type="file"
  7.               required
  8.               inputProps={{
  9.                 style: { color: 'white' },
  10.                 accept: 'audio/*',
  11.               }}
  12.               onChange={handleChange('singleFile')}
  13.             />
  14.             {values.selectSingleFile ? (
  15.               <div>
  16.                 <p>Filename: {values.singleFile.name}</p>
  17.                 <p>Filetype: {values.singleFile.type}</p>
  18.                 <p>Size: {fileSizeFormatter(values.singleFile.size)}</p>
  19.                 <p>
  20.                   Last modified:{' '}
  21.                   {values.singleFile.lastModifiedDate.toLocaleDateString()}
  22.                 </p>
  23.               </div>
  24.             ) : (
  25.               <p>Select a file to show details</p>
  26.             )}
  27.  
  28.             <FormControl>
  29.               <TextField
  30.                 // Single song Title
  31.                 label="Song title"
  32.                 name="title"
  33.                 value={values.singleTitle}
  34.                 inputProps={{
  35.                   style: { color: 'white' },
  36.                 }}
  37.                 required
  38.                 autoComplete="off"
  39.                 onChange={handleChange('singleTitle')}
  40.               />
  41.             </FormControl>
  42.  
  43.             <br />
  44.             <br />
  45.             <FormControl>
  46.               <TextField
  47.                 // Single song Artist name
  48.                 label="Artist"
  49.                 name="artist"
  50.                 value={values.singleArtist}
  51.                 inputProps={{
  52.                   style: { color: 'white' },
  53.                 }}
  54.                 required
  55.                 onChange={handleChange('singleArtist')}
  56.               />
  57.             </FormControl>
  58.  
  59.             <br />
  60.             <br />
  61.             <CustomButton
  62.               // Single song upload button
  63.               name="Upload"
  64.               col="black"
  65.               buttonColor="green-button"
  66.               onSubmit={handleSubmit}
  67.             />
  68.           </form>
Advertisement
Add Comment
Please, Sign In to add comment