Skip to content

Commit

Permalink
improve colors, settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed Hassanein committed Mar 26, 2020
1 parent fba2b2f commit 72e1136
Show file tree
Hide file tree
Showing 10 changed files with 295 additions and 139 deletions.
12 changes: 6 additions & 6 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { app, globalShortcut, ipcMain, BrowserWindow } from 'electron'

import { okk } from '../helpers/helpers'
import { pushTask } from '../tasks/push'
import { startServer } from '../plugins/server'
// import { setContextMenu } from '../plugins/tray'
import { createAppWindow, createSelectWindow } from '../plugins/windows'
import {
Expand Down Expand Up @@ -49,11 +48,12 @@ app.on('ready', () => {
selectWindow = createSelectWindow()
// setContextMenu()

try {
startServer()
} catch (error) {
logger.error('startServer failed!', error)
}
// todo: enable with port
// try {
// startServer()
// } catch (error) {
// logger.error('startServer failed!', error)
// }

try {
registerShortcuts()
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ const startServer = () => {
})
const state = store.getState()

app.listen(okk(state.settings.port), () =>
logger.log(` server listening on port ${state.settings.port}!`),
)
// app.listen(okk(state.settings.port), () =>
// logger.log(` server listening on port ${state.settings.port}!`),
// )
}

export { startServer }
6 changes: 3 additions & 3 deletions src/plugins/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { ISettingsState, IRepoSetting } from '../store/settings/types'

const INITIAL_SETTINGS: ISettingsState = {
reposList: [],
port: 3456,
// port: 3456,
githubAuth: '',
githubUserName: '',
jiraHost: '',
jiraEmail: '',
jiraAuth: '',
jiraJQL: '',
jiraJQL: 'assignee in (currentUser())',
}

const validateSettings = (settings: ISettingsState) => {
Expand All @@ -20,7 +20,7 @@ const validateSettings = (settings: ISettingsState) => {
settings.jiraEmail &&
settings.jiraHost &&
settings.jiraJQL &&
settings.port &&
// settings.port &&
settings.reposList.length &&
settings.reposList.reduce(
(prev, current: IRepoSetting) =>
Expand Down
2 changes: 1 addition & 1 deletion src/store/branches/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const fetchBranches = (): ThunkAction<
let newBranches: TBranches = []

for (const repo of state.settings.reposList) {
if (!repo.shouldMonitor) {
if (!repo.enableAutoRefresh) {
continue
}

Expand Down
6 changes: 2 additions & 4 deletions src/store/settings/reducers.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { settingsStore } from '../../plugins/settings'
import { SAVE_SETTINGS, ISettingsState, TSettingsActionTypes } from './types'
// @ts-ignore
import electronTimber from 'electron-timber'

const logger = electronTimber.create({ name: 'reducers' })
// import electronTimber from 'electron-timber'
// const logger = electronTimber.create({ name: 'reducers' })

const initialState: ISettingsState = settingsStore.getAll()

Expand Down
4 changes: 2 additions & 2 deletions src/store/settings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ export interface IRepoSetting {
remoteName: string
repoId: string
orgID: string
shouldMonitor: boolean
enableAutoRefresh: boolean
}

export interface ISettingsState {
reposList: Array<IRepoSetting>
port: number
// port: number
githubAuth: string
githubUserName: string
jiraHost: string
Expand Down
2 changes: 1 addition & 1 deletion src/store/tickets/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const fetchPRs = (

try {
for (const repo of state.settings.reposList) {
if (repo.shouldMonitor) {
if (repo.enableAutoRefresh) {
const pulls = await getMyExtendedPRs(repo.repoId)
allPRs = [...allPRs, ...pulls]
}
Expand Down
32 changes: 31 additions & 1 deletion src/windows/components/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,34 @@ const Error = styled.span`
color: red;
`

export { BadgeStyle, ClickableBadgeStyle, TextFieldWrapper, Error }
const textColor = '#cacaca'
const settingLinkColor = '#8bc34a'

const Label = styled.label`
font-size: 13px;
margin-bottom: 2px;
color: ${textColor};
`

const SupportLink = styled.span`
margin-left: 10px;
display: inline;
cursor: pointer;
font-size: 13px;
color: ${settingLinkColor};
:hover {
color: white;
}
`

export {
BadgeStyle,
ClickableBadgeStyle,
TextFieldWrapper,
Error,
Label,
SupportLink,
textColor,
settingLinkColor,
}
7 changes: 2 additions & 5 deletions src/windows/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
}

html {
background-color: #343648;
background-color: #181921;
}

body {
font-family: 'Helvetica Neue';
margin: 0;
max-width: 100vw;
padding: 0px;
font-family: monospace;
}
Loading

0 comments on commit 72e1136

Please sign in to comment.