linuxdocker-komponensekupdate #11
@@ -3,14 +3,16 @@
|
|||||||
|
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
|
|
||||||
export default function Button({ text, type, onClick }) {
|
export default function Button({ text, type, onClick, width }) {
|
||||||
|
const widthClass = width ? width : "w-full";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<motion.button
|
<motion.button
|
||||||
whileHover={{ scale: 1.05 }}
|
whileHover={{ scale: 1.05 }}
|
||||||
whileTap={{ scale: 0.95 }}
|
whileTap={{ scale: 0.95 }}
|
||||||
type={type}
|
type={type}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
className="w-full bg-button-primary text-white py-3 rounded-lg hover:bg-button-hover transition shadow-md font-semibold text-lg"
|
className={`${widthClass} bg-button-primary text-white py-3 rounded-lg hover:bg-button-hover transition shadow-md font-semibold text-lg`}
|
||||||
>
|
>
|
||||||
{text}
|
{text}
|
||||||
</motion.button>
|
</motion.button>
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// src/components/Inputs/InputBox.jsx
|
// src/components/Inputs/InputBox.jsx
|
||||||
// InputBox komponens
|
// InputBox komponens
|
||||||
|
|
||||||
export default function InputBox({ type, placeholder, value, onChange }) {
|
export default function InputBox({ type, placeholder, value, onChange, width }) {
|
||||||
return (
|
const widthClass = width ? width : "w-full";
|
||||||
<div className="mb-6 relative">
|
|
||||||
<input
|
return (
|
||||||
type={type}
|
<input
|
||||||
className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:border-background focus:outline-none text-gray-700 placeholder-gray-400 bg-gray-50"
|
type={type}
|
||||||
placeholder={placeholder}
|
className={`${widthClass} px-4 py-3 border border-gray-300 rounded-lg focus:border-background focus:outline-none text-gray-700 placeholder-gray-400 bg-gray-50`}
|
||||||
value={value}
|
placeholder={placeholder}
|
||||||
onChange={onChange}
|
value={value}
|
||||||
/>
|
onChange={onChange}
|
||||||
</div>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export default function LoginForm() {
|
|||||||
{error && (
|
{error && (
|
||||||
<div className="mb-4 text-red-600 text-center font-semibold">{error}</div>
|
<div className="mb-4 text-red-600 text-center font-semibold">{error}</div>
|
||||||
)}
|
)}
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit} className="space-y-6">
|
||||||
<InputBox
|
<InputBox
|
||||||
type="email"
|
type="email"
|
||||||
placeholder="Email cím"
|
placeholder="Email cím"
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export default function RegisterForm() {
|
|||||||
{error && (
|
{error && (
|
||||||
<div className="mb-4 text-red-600 text-center font-semibold">{error}</div>
|
<div className="mb-4 text-red-600 text-center font-semibold">{error}</div>
|
||||||
)}
|
)}
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit} className="space-y-6">
|
||||||
<InputBox
|
<InputBox
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Teljes név"
|
placeholder="Teljes név"
|
||||||
|
|||||||
@@ -1,10 +1,27 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import Button from "../../components/Buttons/Button";
|
||||||
|
import InputBox from "../../components/Inputs/InputBox";
|
||||||
|
|
||||||
export default function Test() {
|
export default function Test() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-red-100 text-white p-4">
|
<div className="w-full h-screen flex flex-col items-center justify-center">
|
||||||
<p className="text-piros">Test</p>
|
<InputBox
|
||||||
|
placeholder="Input"
|
||||||
|
type="text"
|
||||||
|
width="w-1/2"
|
||||||
|
onChange={(e) => {
|
||||||
|
console.log(value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
text="Button"
|
||||||
|
type="button"
|
||||||
|
width="w-1/2"
|
||||||
|
onClick={() => {
|
||||||
|
console.log("Button clicked");
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd ./SerpentRace_Docker || exit 1
|
||||||
|
docker compose watch
|
||||||
|
read -p "Press any key to continue..."
|
||||||
Reference in New Issue
Block a user