Skip to content

Commit

Permalink
fix: react warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Jan 12, 2024
1 parent 3dbe3f3 commit 37cd7eb
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 56 deletions.
36 changes: 18 additions & 18 deletions frontend/src/screens/apps/NewApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,24 +276,23 @@ const NewApp = () => {
>
{Object.keys(budgetOptions).map((budget) => {
return (
<>
<div
onClick={() =>
setMaxAmount(budgetOptions[budget])
}
className={`col-span-2 md:col-span-1 cursor-pointer rounded border-2 ${
maxAmount == budgetOptions[budget]
? "border-purple-700 dark:border-purple-300 text-purple-700 bg-purple-100 dark:bg-purple-900"
: "border-gray-200 dark:border-gray-400"
} text-center py-4 dark:text-white`}
>
{budget}
<br />
{budgetOptions[budget]
? "sats"
: "#reckless"}
</div>
</>
<div
key={budget}
onClick={() =>
setMaxAmount(budgetOptions[budget])
}
className={`col-span-2 md:col-span-1 cursor-pointer rounded border-2 ${
maxAmount == budgetOptions[budget]
? "border-purple-700 dark:border-purple-300 text-purple-700 bg-purple-100 dark:bg-purple-900"
: "border-gray-200 dark:border-gray-400"
} text-center py-4 dark:text-white`}
>
{budget}
<br />
{budgetOptions[budget]
? "sats"
: "#reckless"}
</div>
);
})}
</div>
Expand Down Expand Up @@ -339,6 +338,7 @@ const NewApp = () => {
{Object.keys(expiryOptions).map((expiry) => {
return (
<div
key={expiry}
onClick={() => handleDays(expiryOptions[expiry])}
className={`cursor-pointer rounded border-2 ${
days == expiryOptions[expiry]
Expand Down
80 changes: 42 additions & 38 deletions frontend/src/screens/apps/ShowApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,36 @@ function ShowApp() {
<div className="divide-y divide-gray-200 dark:divide-white/10 dark:bg-surface-02dp">
<div className="pb-4">
<table>
<tr>
<td className="align-top w-32 font-medium dark:text-white">
Public Key
</td>
<td className="text-gray-600 dark:text-neutral-400 break-all">
{app.nostrPubkey}
</td>
</tr>
<tr>
<td className="align-top font-medium dark:text-white">
Last used
</td>
<td className="text-gray-600 dark:text-neutral-400">
{app.lastEventAt
? new Date(app.lastEventAt).toLocaleDateString()
: "never"}
</td>
</tr>
<tr>
<td className="align-top font-medium dark:text-white">
Expires at
</td>
<td className="text-gray-600 dark:text-neutral-400">
{app.expiresAt
? new Date(app.expiresAt).toLocaleDateString()
: "never"}
</td>
</tr>
<tbody>
<tr>
<td className="align-top w-32 font-medium dark:text-white">
Public Key
</td>
<td className="text-gray-600 dark:text-neutral-400 break-all">
{app.nostrPubkey}
</td>
</tr>
<tr>
<td className="align-top font-medium dark:text-white">
Last used
</td>
<td className="text-gray-600 dark:text-neutral-400">
{app.lastEventAt
? new Date(app.lastEventAt).toLocaleDateString()
: "never"}
</td>
</tr>
<tr>
<td className="align-top font-medium dark:text-white">
Expires at
</td>
<td className="text-gray-600 dark:text-neutral-400">
{app.expiresAt
? new Date(app.expiresAt).toLocaleDateString()
: "never"}
</td>
</tr>
</tbody>
</table>
</div>

Expand All @@ -106,16 +108,18 @@ function ShowApp() {
{app.maxAmount > 0 && (
<div className="pl-6">
<table className="text-gray-600 dark:text-neutral-400">
<tr>
<td className="font-medium">Budget</td>
<td>
{app.maxAmount} sats ({app.budgetUsage} sats used)
</td>
</tr>
<tr>
<td className="font-medium pr-3">Renews</td>
<td>{app.budgetRenewal}</td>
</tr>
<tbody>
<tr>
<td className="font-medium">Budget</td>
<td>
{app.maxAmount} sats ({app.budgetUsage} sats used)
</td>
</tr>
<tr>
<td className="font-medium pr-3">Renews</td>
<td>{app.budgetRenewal}</td>
</tr>
</tbody>
</table>
</div>
)}
Expand Down

0 comments on commit 37cd7eb

Please sign in to comment.