Skip to content

Commit

Permalink
Merge pull request #104 from napse-invest/feature/server
Browse files Browse the repository at this point in the history
Feature/server
  • Loading branch information
tomjeannesson authored Oct 16, 2023
2 parents 9601622 + 2093a8b commit 41427c6
Show file tree
Hide file tree
Showing 31 changed files with 844 additions and 742 deletions.
3 changes: 2 additions & 1 deletion desktop-app/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"extends": [
"plugin:react/recommended",
"plugin:tailwindcss/recommended",
"next/core-web-vitals"
"next/core-web-vitals",
"next/babel"
],
"parserOptions": {
"ecmaVersion": "latest",
Expand Down
2 changes: 1 addition & 1 deletion desktop-app/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ files:

linux:
target: deb
icon: renderer/public/images/icon.png
icon: renderer/public/images/logo.svg

publish: null
4 changes: 2 additions & 2 deletions desktop-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-tailwind": "^0.2.1",
"eslint-plugin-tailwindcss": "^3.13.0",
"next": "^13.4.19",
"next": "^13.5.5",
"nextron": "^8.5.0",
"postcss": "^8.4.13",
"prettier": "^3.0.2",
Expand All @@ -87,4 +87,4 @@
"tailwindcss": "^3.1.8",
"typescript": "5.2.2"
}
}
}
14 changes: 13 additions & 1 deletion desktop-app/renderer/api/key/key.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { request } from 'api/request'
import { AxiosResponse } from 'axios'
import axios, { AxiosResponse } from 'axios'
import { useSearchParams } from 'next/navigation'

export interface Key {
Expand Down Expand Up @@ -91,3 +91,15 @@ export async function updateKey(
)
return response as AxiosResponse<null>
}

export async function connectKey(serverUrl: string, token: string) {
const response = await axios({
method: 'GET',
url: '/api/key/connect/',
baseURL: serverUrl,
headers: {
Authorization: 'Api-Key ' + token
}
})
return response as AxiosResponse<null>
}
20 changes: 9 additions & 11 deletions desktop-app/renderer/components/custom/copyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { CheckIcon, CopyIcon } from '@radix-ui/react-icons'
import * as React from 'react'

import { Button } from '@/components/ui/button'
import { cn } from '@/lib/utils'
import { useTheme } from 'next-themes'
import { useEffect, useState } from 'react'

interface CopyButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
value: string
Expand All @@ -20,10 +21,10 @@ export default function CopyButton({
src,
copyTrigger,
...props
}: CopyButtonProps) {
const [hasCopied, setHasCopied] = React.useState(false)

React.useEffect(() => {
}: CopyButtonProps): JSX.Element {
const theme = useTheme()
const [hasCopied, setHasCopied] = useState(false)
useEffect(() => {
setTimeout(() => {
setHasCopied(false)
}, 2000)
Expand All @@ -33,10 +34,7 @@ export default function CopyButton({
<Button
size="icon"
variant="ghost"
className={cn(
'bg-foreground relative z-10 h-6 w-6 text-zinc-50',
className
)}
className={cn('bg-foreground relative z-10 h-6 w-6 ', className)}
onClick={() => {
copyToClipboardWithMeta(value)
setHasCopied(true)
Expand All @@ -46,9 +44,9 @@ export default function CopyButton({
>
<span className="sr-only">Copy</span>
{hasCopied ? (
<CheckIcon className="h-3 w-3" />
<CheckIcon className="h-3 w-3" color="background" />
) : (
<CopyIcon className="h-3 w-3" />
<CopyIcon className="h-3 w-3" color="background" />
)}
</Button>
)
Expand Down
Loading

0 comments on commit 41427c6

Please sign in to comment.