Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dcgleason committed Jan 3, 2023
1 parent 3f52611 commit 2e965dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 83 deletions.
4 changes: 2 additions & 2 deletions components/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function Home() {
<rect x="11.6666" y="3.3335" width={5} height="8.33333" rx="1.66667" stroke="white" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" />
</svg>
</div>
<p className="ml-2">Add/Edit Contributors</p>
<p className="ml-2">Control Panel</p>
</div>
</a>
<a href="./edit">
Expand All @@ -74,7 +74,7 @@ export default function Home() {
<path d="M3.33337 12.5L6.66671 7.5L10 9.16667L13.3334 5L16.6667 8.33333" stroke="#CBD5E0" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" />
</svg>
</div>
<p className="ml-2">Add/Edit Contributions</p>
<p className="ml-2">Edit Order</p>
</div>
</a>
<a href="/submit">
Expand Down
6 changes: 5 additions & 1 deletion pages/contributors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


import { Button, Table, Modal, Input, Select, Upload, message } from "antd";
import { Button, Table, Modal, Input, Select, Upload, message, notification } from "antd";
import { useState } from "react";
import { EditOutlined, DeleteOutlined, InboxOutlined } from "@ant-design/icons";
import Papa from "papaparse";
Expand Down Expand Up @@ -160,6 +160,10 @@ const CSV = () => {
}
if (info.file.status === "done") {
message.success(`${info.file.name} file uploaded successfully`);
notification.success({
message: 'Picture successfully uploaded',
duration: 2,
});
setPictureSubmitted(true);
} else if (info.file.status === "error") {
message.error(`${info.file.name} file upload failed.`);
Expand Down
82 changes: 2 additions & 80 deletions pages/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,89 +122,11 @@ function DragApp() {

<div >

<div className="grid grid-cols-2 divide-x-2 divide-gray-400">
<div className="col-span-1 p-6">

<form className="space-y-8 divide-y divide-gray-200" action="#" method="POST">
<div className="sm:grid sm:grid-cols-3 sm:gap-4 sm:items-start sm:border-t sm:border-gray-200 sm:pt-5">
<label htmlFor="username" className="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">
<em>Upload a note manually: </em>
</label>
<div className="mt-1 sm:mt-0 sm:col-span-2">
<div className="max-w-lg flex rounded-md shadow-sm">
<textarea
id="about"
name="about"
spellCheck="true"
placeholder="Dear Elle, ... Sincerely, [Your name]"
rows={8}
onChange={e => setQuestionOne(e.target.value)}
value={questionOne}
className="max-w-lg shadow-sm block w-full focus:ring-red-500 focus:border-red-500 sm:text-sm border border-gray-300 rounded-md"
/>
</div>
</div>
</div>




<div className="sm:grid sm:grid-cols-3 sm:gap-4 sm:items-start sm:border-t sm:border-gray-200 sm:pt-5">
<label htmlFor="cover-photo" className="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2"> Photo: </label>
<div className="mt-1 sm:mt-0 sm:col-span-2">
<div className="max-w-lg flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md">
<div className="space-y-1 text-center">
{ !selectedImage? <svg className="mx-auto h-12 w-12 text-gray-400" stroke="currentColor" fill="none" viewBox="0 0 48 48" aria-hidden="true">
<path d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02" style={{ strokeWidth: 2, strokeLinecap:"round", strokeLinejoin:"round" }}/>
</svg> : <div> </div>}
<div className="flex text-sm text-gray-600">
{ selectedImage ? <label htmlFor="file-upload"> <span className="relative bg-white rounded-md font-medium text-grey-700 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-red-500"> Image Ready to Send</span> </label>: (<>
<label htmlFor="file-upload" className="relative cursor-pointer bg-white rounded-md font-medium text-red-600 hover:text-red-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-red-500">

<span>Upload a image</span>
<input
id="file-upload"
name="file-upload"
type="file"
onChange={(event) => {
console.log(event.target.files[0]);
setSelectedImage(event.target.files[0]);
}}
className="sr-only"/>
</label>
<p className="pl-1">here</p>
</>
)}
</div>
<p className="text-xs text-gray-500">PNG or JPG up to 16MB</p>
</div>
</div>
</div>
</div>
<div className="pt-5">
<div className="flex justify-end">

<button
type="button"
onClick = {() => {
setItems([...items, { id: items.length + 1, title: "testing" , body: questionOne}]);

}}
className="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500"
>
Upload
</button>
</div>
</div>
</form>

</div>


<div className="grid grid-cols-1">
<div className="col-span-1 p-6 mx-10 ">
<div className="flex flex-col items-center justify-center min-h-screen py-2">
<label className="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">
<em>Drag and Drop to reorder your notes (this is the order that your contributions will appear in your Bundle): </em>
<em>Drag and Drop to reorder your notes (this is the order that your contributions will appear in your Bundle...hint: the "Save Order" button is at the very bottom): </em>
</label>
<div
style={{
Expand Down

0 comments on commit 2e965dc

Please sign in to comment.