Skip to content

Commit

Permalink
icons and update
Browse files Browse the repository at this point in the history
  • Loading branch information
ceddybi committed Jan 31, 2024
1 parent 9db9fa7 commit 52d4014
Show file tree
Hide file tree
Showing 11 changed files with 248 additions and 37 deletions.
14 changes: 14 additions & 0 deletions forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { rendererConfig } from './webpack.renderer.config';

const config: ForgeConfig = {
packagerConfig: {
name: packageJson.productName,
icon: './src/assets/icon',
asar: true,
protocols: [
{
Expand Down Expand Up @@ -47,6 +49,18 @@ const config: ForgeConfig = {
},
}),
],
publishers: [
{
name: '@electron-forge/publisher-github',
config: {
repository: {
owner: 'ceddybi',
name: 'AIJ'
},
prerelease: true
}
}
]
};

export default config;
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"name": "ceddybi",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "[email protected]:ceddybi/AIJ.git"
},
"license": "MIT",
"devDependencies": {
"@electron-forge/cli": "^7.2.0",
Expand Down Expand Up @@ -45,6 +49,7 @@
"typescript": "~4.5.4"
},
"dependencies": {
"@electron-forge/publisher-github": "^7.2.0",
"@headlessui/tailwindcss": "^0.2.0",
"@heroicons/react": "^2.1.1",
"@tremor/react": "^3.13.3",
Expand All @@ -56,6 +61,7 @@
"puppeteer": "^21.9.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwindcss": "^3.4.1"
"tailwindcss": "^3.4.1",
"update-electron-app": "^3.0.0"
}
}
22 changes: 11 additions & 11 deletions src/app/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ export const Dashboard = ({ state }: LayoutPageProps) => {
return (
<Card>
<Grid numItems={1} numItemsSm={2} numItemsLg={2} className="gap-3">
<div>
<div className="flex flex-col items-center w-full">
<div className="flex items-center">
<Metric>Jobs</Metric>
<Bold>Jobs</Bold>
<div className="p-3">
<Bold> {jobs.length} </Bold>
<Metric> {jobs.length} </Metric>
</div>
</div>

<div className="rounded-md shadow-sm mb-2">
<div className="rounded-md shadow-sm mb-2 w-full">
<input
value={search}
name="search"
Expand All @@ -74,7 +74,7 @@ export const Dashboard = ({ state }: LayoutPageProps) => {
loading={isListRunning}
>
{" "}
{!isListRunning ? "Run" : "Running"}{" "}
{!isListRunning ? "Fetch jobs" : "Fetching jobs ...."}{" "}
</Button>

<div className="ml-2">
Expand All @@ -84,18 +84,18 @@ export const Dashboard = ({ state }: LayoutPageProps) => {
onClick={() => invokeEvent("list:stop", search)}
>
{" "}
Stop{" "}
Stop fetching{" "}
</Button>
)}
</div>
</div>
</div>

<div>
<div className="flex flex-col items-center w-full justify-center">
<div className="flex items-center">
<Metric>Applications</Metric>
<Bold>Applications</Bold>
<div className="p-3">
<Bold> {applied.length} </Bold>
<Metric> {applied.length} </Metric>
</div>
</div>

Expand All @@ -106,7 +106,7 @@ export const Dashboard = ({ state }: LayoutPageProps) => {
loading={isAppRunning}
>
{" "}
{!isAppRunning ? "Run" : "Running"}{" "}
{!isAppRunning ? "Apply with AI" : "AI Applying ..."}{" "}
</Button>

<div className="ml-2">
Expand All @@ -116,7 +116,7 @@ export const Dashboard = ({ state }: LayoutPageProps) => {
onClick={() => invokeEvent("app:stop", searchUrl)}
>
{" "}
Stop{" "}
Stop AI{" "}
</Button>
)}
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,18 @@ export const Layout = () => {

const isAuth = _get(state, "auth.res.success");

if (!state) {
return null;
}

if (!isAuth) {
return (
<div className="h-full bg-gray-50 w-full">
<AuthPage />
</div>
);
};
}

return (
<div className="h-full bg-gray-50 w-full">
<Navbar user={null} />
Expand Down
56 changes: 35 additions & 21 deletions src/app/questions/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const RenderCheckbox = ({
</span>
</label>
<label
className="mt-px font-light text-gray-700 cursor-pointer select-none w-full"
className="mt-px font-light text-gray-700 cursor-pointer select-none w-full text-xl"
htmlFor={id}
>
{title}
Expand Down Expand Up @@ -119,6 +119,8 @@ const RenderQuestion = ({
case "text":
return (
<Textarea
className="w-full text-xl"
rows={15}
value={questionAnswerText}
onChange={(e) => {
const answer = {
Expand Down Expand Up @@ -329,34 +331,46 @@ export const ListQuestions = () => {
overflowY: "scroll",
}}
>
{filteredQuestions.map((item) => (
<ListItem
onClick={() => setSelectedQuestion(item as QuestionAnswer)}
key={item.question.inputId}
className=" hover:bg-gray-100 cursor-pointer px-2"
>
<p className="truncate">{item.question.question}</p>
{item.isNew && (
<Text>
<Badge>New</Badge>{" "}
</Text>
)}
</ListItem>
))}
{filteredQuestions.map((item) => {
const selectedQuesId = _get(
selectedQuestion,
"question.inputId"
);
const currentQuesId = _get(item, "question.inputId");
const isSelected = selectedQuesId === currentQuesId;
return (
<ListItem
onClick={() => setSelectedQuestion(item as QuestionAnswer)}
key={item.question.inputId}
className={` hover:bg-gray-100 cursor-pointer px-2 ${
isSelected ? "bg-gray-200" : ""
}`}
>
<Title className="truncate">{item.question.question}</Title>
{item.isNew && (
<Text>
<Badge>New</Badge>{" "}
</Text>
)}
</ListItem>
);
})}
</List>
</Col>

{selectedQuestion && (
<Col numColSpan={1} numColSpanLg={2}>
<div>
<div className="m-1">
<div className="">
<div style={{ marginBottom: "20px" }}>
<Metric>{selectedQuestion.question.question}</Metric>
</div>

<RenderQuestion
question={selectedQuestion}
handleChangeAnswer={handleChangeAnswer}
/>
<div>
<RenderQuestion
question={selectedQuestion}
handleChangeAnswer={handleChangeAnswer}
/>
</div>

<div className="flex justify-center mt-2">
<button
Expand Down
Binary file added src/assets/AIJ.icns
Binary file not shown.
Binary file added src/assets/AIJ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icon.icns
Binary file not shown.
Binary file added src/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import { gotoAppPage, gotoMainPage } from './config/app';
import { getAuthApi } from './api';
import packageJson from '../package.json';
import path from 'node:path';
import { updateElectronApp } from "update-electron-app";

const appName = packageJson.name;
updateElectronApp();

const appName = packageJson.name;
const appEvents = AppEvents.Instance;
// This allows TypeScript to pick up the magic constants that's auto-generated by Forge's Webpack
// plugin that tells the Electron app where to look for the Webpack-bundled app code (depending on
Expand Down Expand Up @@ -96,6 +98,7 @@ if (require('electron-squirrel-startup')) {
const createWindow = (): void => {
// Create the browser window.
mainWindow = new BrowserWindow({
icon: path.join(__dirname, 'assets/icon.png'),
height: 700,
width: 1000,
webPreferences: {
Expand Down
Loading

0 comments on commit 52d4014

Please sign in to comment.