Skip to content

Commit

Permalink
Merge pull request #19 from casrpg/cca/add-basic-styles-to-npc-generator
Browse files Browse the repository at this point in the history
Add basic styles to npc generator
  • Loading branch information
carloscasalar authored Oct 25, 2024
2 parents af403c6 + c757902 commit 85a3ff2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
38 changes: 19 additions & 19 deletions app/src/features/NPCGenerator.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import React, { useState } from 'react'
import { Heading } from '../lcars/Heading'
import { List } from '../lcars/List'
import { ListItem } from '../lcars/ListItem'
import { ButtonBar } from '../lcars/ButtonBar'
import { Button } from '../lcars/Button'
interface NPC {
name: string
occupation: string
Expand All @@ -20,24 +25,19 @@ export const NPCGenerator: React.FC = () => {
}

return (
<div className="lcars-panel">
<h2 className="mb-4 text-2xl font-bold lcars-header">NPC Generator</h2>
<div className="lcars-content">
<button
onClick={generateNPC}
className="mb-4 lcars-button"
>
Generate NPC
</button>
{npc && (
<div className="mt-4">
<div className="lcars-element">{npc.name}</div>
<div className="lcars-element">Occupation: {npc.occupation}</div>
<div className="lcars-element">Skills: {npc.skills.join(', ')}</div>
<div className="lcars-element">Equipment: {npc.equipment.join(', ')}</div>
</div>
)}
</div>
</div>
<>
<Heading align="left">NPC Generator</Heading>
<ButtonBar alignment="space-between">
<Button color="orange" onClick={generateNPC}>Generate NPC</Button>
</ButtonBar>
{npc && (
<List>
<ListItem color="orange" >Name: {npc.name}</ListItem>
<ListItem color="cyan">Occupation: <span className="cyan">{npc.occupation}</span></ListItem>
<ListItem color="green">Skills: <span className="green">{npc.skills.join(', ')}</span></ListItem>
<ListItem color="pale-orange">Equipment: <span className="pale-orange">{npc.equipment.join(', ')}</span></ListItem>
</List>
)}
</>
)
}
2 changes: 1 addition & 1 deletion app/src/features/PlanetDecoder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from 'react'
import { Heading } from '../lcars/Heading'
import './PlanetDecoder.css'
import { ButtonBar } from '../lcars/ButtonBar'
import Button from '../lcars/Button'
import { Button } from '../lcars/Button'
import { List } from '../lcars/List'
import { ListItem } from '../lcars/ListItem'
interface PlanetInfo {
Expand Down
4 changes: 1 addition & 3 deletions app/src/lcars/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface ButtonProps {
onClick?: () => void
}

const Button: FC<PropsWithChildren<ButtonProps>> = ({ color, className, onClick, children }) => {
export const Button: FC<PropsWithChildren<ButtonProps>> = ({ color, className, onClick, children }) => {
return (
<a
role="button"
Expand All @@ -25,5 +25,3 @@ const Button: FC<PropsWithChildren<ButtonProps>> = ({ color, className, onClick,
</a>
)
}

export default Button

0 comments on commit 85a3ff2

Please sign in to comment.