mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
tailswinds fixed
This commit is contained in:
@@ -18,7 +18,7 @@ const AddBrand: FC<Props> = ({ createBrand }) => {
|
||||
// Rendering the AddBrand component
|
||||
return (
|
||||
<div className="w-full flex gap-1 mt-2">
|
||||
{/* Input field for entering new brand text */}
|
||||
{/* Input field for entering new brand name */}
|
||||
<input
|
||||
type="text"
|
||||
className="w-full px-2 py-1 border border-gray-200 rounded outline-none"
|
||||
|
||||
@@ -8,15 +8,15 @@ interface Props {
|
||||
brands: brandType[];
|
||||
}
|
||||
const Brands: FC<Props> = ({ brands }) => {
|
||||
// State to manage the list of todo items
|
||||
// State to manage the list of brand items
|
||||
const [brandItems, setBrandItems] = useState<brandType[]>(brands);
|
||||
// Function to create a new todo item
|
||||
// Function to create a new brand item
|
||||
const createBrand = (name: string) => {
|
||||
const id = (brandItems.at(-1)?.id || 0) + 1;
|
||||
addBrand(name);
|
||||
setBrandItems((prev) => [...prev, { id: id, name: name }]);
|
||||
};
|
||||
// Function to change the text of a todo item
|
||||
// Function to change the text of a brand item
|
||||
const changeBrandName = (id: number, name: string) => {
|
||||
setBrandItems((prev) =>
|
||||
prev.map((brand) => (brand.id === id ? { ...brand, name } : brand))
|
||||
@@ -32,9 +32,9 @@ const Brands: FC<Props> = ({ brands }) => {
|
||||
// Rendering the brand List component
|
||||
return (
|
||||
<main className="flex mx-auto max-w-xl w-full min-h-screen flex-col items-center p-16">
|
||||
<div className="text-5xl font-medium">To-do app</div>
|
||||
<div className="text-5xl font-medium">Ballistic Builder Brand</div>
|
||||
<div className="w-full flex flex-col mt-8 gap-2">
|
||||
{/* Mapping through todoItems and rendering Todo component for each */}
|
||||
{/* Mapping through brand items and rendering brand component for each */}
|
||||
{brandItems.map((brand) => (
|
||||
<Brand
|
||||
key={brand.id}
|
||||
@@ -44,7 +44,7 @@ const Brands: FC<Props> = ({ brands }) => {
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
{/* Adding Todo component for creating new todos */}
|
||||
{/* Adding brand component for creating new brand */}
|
||||
<AddBrand createBrand={createBrand} />
|
||||
</main>
|
||||
);
|
||||
|
||||
@@ -2,8 +2,8 @@ import type { Config } from "tailwindcss";
|
||||
|
||||
export default {
|
||||
content: [
|
||||
'./src/app/pages/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./src/app/components/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./src/app/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./src/**/*.{js, ts, jsx, tsx,mdx}',
|
||||
|
||||
Reference in New Issue
Block a user