Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": true
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": []
}
18 changes: 18 additions & 0 deletions components/Admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Head from './Head'
import Footer from './Footer'
import Header from './Header'
import Main from './Main'


export default function Admin({username,password}){ const [title,setTitle] = useState('Cookie Stand Admin');
const [branches,setBranches] = useState('0')
const [path,setPath] = useState("/overview")
const [page,setPage] = useState("overview")
return (
<div className="bg-green-100">
<Head title={title}/>
<Header header={title} path={path} page={page} username={username}/>
<Main title={title} setBranches={setBranches} username={username} password={password}/>
<Footer branches={branches} />
</div>
)}
2 changes: 0 additions & 2 deletions components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export default function Header(props) {
</div>
</div>
</nav>


</header>
)
}
95 changes: 95 additions & 0 deletions components/Login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { useState } from 'react'


export default function Login({change}){
const [userName,setUserName] = useState("")
const [password,setPassword] = useState("")
function changeUser(event){
setUserName(event.target.value)
}

function changePassword(event){
setPassword(event.target.value)
}

function login(){
change(userName,password)
}

return (
<div className="w-full flex justify-center pt-3 ">
<form className="px-8 pt-6 pb-8 mb-4 bg-green-200 rounded shadow-md " >
<div className="mb-4">
<label className="block mb-2 text-sm font-bold text-gray-700" >
Username
</label>
<input name="username" className="w-full px-3 py-2 leading-tight text-gray-700 border rounded shadow appearance-none focus:outline-none focus:shadow-outline" id="username" type="text" placeholder="Username" onChange={changeUser}/>
</div>
<div className="mb-6">
<label className="block mb-2 text-sm font-bold text-gray-700" >
Password
</label>
<input name="password" className="w-full px-3 py-2 mb-3 leading-tight text-gray-700 border border-red-500 rounded shadow appearance-none focus:outline-none focus:shadow-outline" id="password" type="password" placeholder="******************" onChange={changePassword}/>
</div>
<div className="flex items-center justify-center">
<button onClick={login} className="px-4 py-2 font-bold text-white bg-green-700 rounded hover:bg-blue-700 focus:outline-none focus:shadow-outline" type="button">
Sign In
</button>
</div>
</form>
</div>
);
}



// import { useState } from 'react'
// // Context
// export default function LoginForm({ onSubmit }) {

// const initialValues = {
// username: '',
// password: '',
// }

// const [values, setValues] = useState(initialValues);

// function submitHandler(event) {
// event.preventDefault();
// console.log(values,"+++++++++++++++++++++++")
// onSubmit(values);
// setValues(initialValues)
// }

// function inputChangeHandler(event) {

// let { name, value } = event.target;

// setValues({ ...values, [name]: value });
// }

// return (
// <div className="w-full max-w-xs">
// <form className="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4" onSubmit={submitHandler}>
// <div className="mb-4">
// <label className="block text-gray-700 text-sm font-bold mb-2" htmlFor="username">
// Username
// </label>
// <input className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" type="text" name="username" id="username" value={values.username} onChange={inputChangeHandler} placeholder="User Name"/>
// </div>
// <div className="mb-6">
// <label className="block text-gray-700 text-sm font-bold mb-2" htmlFor="password">
// Password
// </label>
// <input className="shadow appearance-none border border-red-500 rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline" type="password" name="password" id="password" value={values.password} onChange={inputChangeHandler} placeholder="password"/>
// <p className="text-red-500 text-xs italic">Please choose a password.</p>
// </div>
// <div className="flex items-center justify-between">
// <button className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" type="submit" >
// Sign In
// </button>
// </div>
// </form>
// </div>
// );
// }
133 changes: 11 additions & 122 deletions components/Main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react/jsx-key */
import { useState } from 'react'
import Image from 'next/image'

Expand All @@ -6,24 +7,24 @@ export default function Main(props) {
const [data, setData] = useState(
[
{
'id': "1",
'id': "#1",
'problem': 'problem1',
'description': 'description1',
'level ': 'level 1',
'level': 'level 1',
},

{
'id': "2",
'id': "#2",
'problem': 'problem2',
'description': 'description2',
'level ': 'level 2',
'level': 'level 2',
},

{
'id': "3",
'id': "#3",
'problem': 'problem3',
'description': 'description3',
'level ': 'level 3',
'level': 'level 3',
},
]
);
Expand All @@ -37,16 +38,15 @@ export default function Main(props) {
<div className="p-10 grid grid-cols-1 sm:grid-cols-1 md:grid-cols-1 lg:grid-cols-1 xl:grid-cols-3 gap-5">


{data.map(item => {
{data.map(item => (
<div>
<h2>hello </h2>
<a href="#2" className="w-full lg:max-w-full ">
<a href={item.id} className="w-full lg:max-w-full ">
<div className="h-48 lg:h-auto lg:w-48 flex-none bg-cover rounded-t lg:rounded-t-none lg:rounded-l text-center overflow-hidden" styles="background-image: url('/mountain.jpg')" >
</div>
<div className=" border-gray-400 lg:border-l-0 lg:border-t lg:border-gray-400 bg-white rounded-b lg:rounded-b-none lg:rounded-r p-4 flex flex-col justify-between leading-normal">
<div className="mb-8">

<div className="text-gray-900 font-bold text-xl mb-2">{item.problem} 1 </div>
<div className="text-gray-900 font-bold text-xl mb-2">{item.problem} </div>
<p className="text-gray-700 text-base">{item.description} Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.</p>
</div>
<div className="flex items-center">
Expand All @@ -58,118 +58,7 @@ export default function Main(props) {
</div>
</a>
</div>
})}



<a href="#2" className="w-full lg:max-w-full ">
<div className="h-48 lg:h-auto lg:w-48 flex-none bg-cover rounded-t lg:rounded-t-none lg:rounded-l text-center overflow-hidden" styles="background-image: url('/mountain.jpg')" >
</div>
<div className=" border-gray-400 lg:border-l-0 lg:border-t lg:border-gray-400 bg-white rounded-b lg:rounded-b-none lg:rounded-r p-4 flex flex-col justify-between leading-normal">
<div className="mb-8">

<div className="text-gray-900 font-bold text-xl mb-2">{data[0].problem} 1 </div>
<p className="text-gray-700 text-base">{data.description} Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.</p>
</div>
<div className="flex items-center">
<div className="text-sm">
<p className="text-gray-900 leading-none">level</p>
<p className="text-gray-600">{data.level}</p>
</div>
</div>
</div>
</a>


<a href="#" className="w-full lg:max-w-full ">
<div className="h-48 lg:h-auto lg:w-48 flex-none bg-cover rounded-t lg:rounded-t-none lg:rounded-l text-center overflow-hidden" styles="background-image: url('/river.jpg')" >
</div>
<div className=" border-gray-400 lg:border-l-0 lg:border-t lg:border-gray-400 bg-white rounded-b lg:rounded-b-none lg:rounded-r p-4 flex flex-col justify-between leading-normal">
<div className="mb-8">

<div className="text-gray-900 font-bold text-xl mb-2">{data.problem} 2 </div>
<p className="text-gray-700 text-base">{data.description} Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.</p>
</div>
<div className="flex items-center">
<div className="text-sm">
<p className="text-gray-900 leading-none">level</p>
<p className="text-gray-600">{data[0].level}</p>

</div>
</div>
</div>
</a>
<a href="#" className="w-full lg:max-w-full ">
<div className="h-48 lg:h-auto lg:w-48 flex-none bg-cover rounded-t lg:rounded-t-none lg:rounded-l text-center overflow-hidden" styles="background-image: url('/forest.jpg')" >
</div>
<div className=" border-gray-400 lg:border-l-0 lg:border-t lg:border-gray-400 bg-white rounded-b lg:rounded-b-none lg:rounded-r p-4 flex flex-col justify-between leading-normal">
<div className="mb-8">

<div className="text-gray-900 font-bold text-xl mb-2">{data.problem} 3 </div>
<p className="text-gray-700 text-base">{data.description} Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.</p>
</div>
<div className="flex items-center">
<div className="text-sm">
<p className="text-gray-900 leading-none">level</p>
<p className="text-gray-600">{data.level}</p>
</div>
</div>
</div>
</a>

<a href="#" className="w-full lg:max-w-full ">
<div className="h-48 lg:h-auto lg:w-48 flex-none bg-cover rounded-t lg:rounded-t-none lg:rounded-l text-center overflow-hidden" styles="background-image: url('/mountain.jpg')" >
</div>
<div className=" border-gray-400 lg:border-l-0 lg:border-t lg:border-gray-400 bg-white rounded-b lg:rounded-b-none lg:rounded-r p-4 flex flex-col justify-between leading-normal">
<div className="mb-8">

<div className="text-gray-900 font-bold text-xl mb-2">{data.problem} 4 </div>
<p className="text-gray-700 text-base">{data.description} Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.</p>
</div>
<div className="flex items-center">
<div className="text-sm">
<p className="text-gray-900 leading-none">level</p>
<p className="text-gray-600">{data.level}</p>
</div>
</div>
</div>
</a>


<a href="#" className="w-full lg:max-w-full ">
<div className="h-48 lg:h-auto lg:w-48 flex-none bg-cover rounded-t lg:rounded-t-none lg:rounded-l text-center overflow-hidden" styles="background-image: url('/river.jpg')" >
</div>
<div className=" border-gray-400 lg:border-l-0 lg:border-t lg:border-gray-400 bg-white rounded-b lg:rounded-b-none lg:rounded-r p-4 flex flex-col justify-between leading-normal">
<div className="mb-8">

<div className="text-gray-900 font-bold text-xl mb-2">{data.problem} 5 </div>
<p className="text-gray-700 text-base">{data.description} Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.</p>
</div>
<div className="flex items-center">
<div className="text-sm">
<p className="text-gray-900 leading-none">level</p>
<p className="text-gray-600">{data.level}</p>
</div>
</div>
</div>
</a>
<a href="#6" className="w-full lg:max-w-full ">
<div className="h-48 lg:h-auto lg:w-48 flex-none bg-cover rounded-t lg:rounded-t-none lg:rounded-l text-center overflow-hidden" styles="background-image: url('/forest.jpg')" >
</div>
<div className=" border-gray-400 lg:border-l-0 lg:border-t lg:border-gray-400 bg-white rounded-b lg:rounded-b-none lg:rounded-r p-4 flex flex-col justify-between leading-normal">
<div className="mb-8">

<div className="text-gray-900 font-bold text-xl mb-2">{data.problem} 6 </div>
<p className="text-gray-700 text-base">{data.description} Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.</p>
</div>
<div className="flex items-center">
<div className="text-sm">
<p className="text-gray-900 leading-none">level</p>
<p className="text-gray-600">{data.level}</p>
</div>
</div>
</div>
</a>
))}
</div>
</main >
)
Expand Down
Loading