Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toast and modal improvements #343

Merged
merged 21 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
637a3e0
updates to toast + toast for preferences
pegahvaezi Oct 27, 2023
86ee74f
some styling fixes and updates to modals
pegahvaezi Oct 28, 2023
52ae387
Merge branch 'main' into toast
Connoropolous Oct 30, 2023
3430eaa
fix scrolling on sign up page
Connoropolous Oct 30, 2023
f9658cc
generate passphrase for imported projects randomly
Connoropolous Oct 30, 2023
bd643bd
modal css improvements for join and create project
pegahvaezi Oct 30, 2023
bfc2830
Merge branch 'toast' of https://github.com/lightningrodlabs/acorn int…
pegahvaezi Oct 30, 2023
1bf64af
Apply suggestions from code review
Connoropolous Oct 30, 2023
8ab48e0
remove ProjectExported modal and use Toast
Connoropolous Oct 30, 2023
b19eca9
fix project settings editing bug
Connoropolous Oct 30, 2023
8c559cc
remove project created modal and add toast for create project
pegahvaezi Oct 30, 2023
0b76157
Merge branch 'toast' of https://github.com/lightningrodlabs/acorn int…
pegahvaezi Oct 30, 2023
74dfcfa
move multieditbar to left side of the screen
pegahvaezi Oct 30, 2023
570ebf8
remove project join followup modal and add toast for join project
pegahvaezi Oct 30, 2023
227c944
add toast for project secret copied to clipboard
pegahvaezi Oct 30, 2023
609df53
invite members modal cleanups
pegahvaezi Oct 30, 2023
7445c1f
add small scope checkbox option to create outcome card
pegahvaezi Oct 31, 2023
c54572b
some dashboard component cleanups
pegahvaezi Oct 31, 2023
362321f
save changes on expanded view when closing with esc key
pegahvaezi Oct 31, 2023
83e5d16
pipe logging in and parse and categorize it
Connoropolous Nov 1, 2023
e546713
hook up keyboard listeners for MapViewCreateOutcome
Connoropolous Nov 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"eslint-plugin-import": "^2.22.1"
},
"dependencies": {
"@lightningrodlabs/electron-holochain": "=0.7.8",
"@lightningrodlabs/electron-holochain": "=0.7.12",
"electron-context-menu": "^3.5.0",
"electron-default-menu": "^1.0.2",
"electron-log": "^4.3.5",
Expand Down
5 changes: 2 additions & 3 deletions electron/src/holochain.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import * as path from 'path'
import { app } from 'electron'
import {
ElectronHolochainOptions,
StateSignal,
PathOptions,
} from '@lightningrodlabs/electron-holochain'
import { DATASTORE_PATH, KEYSTORE_PATH, PROFILES_HAPP_PATH } from './paths'

Expand Down Expand Up @@ -53,6 +50,7 @@ const devOptions: ElectronHolochainOptions = {
keystorePath: KEYSTORE_PATH,
passphrase: 'test-passphrase',
bootstrapUrl: 'https://bootstrap.holo.host',
logging: 'Json',
}
const prodOptions: ElectronHolochainOptions = {
happPath: PROFILES_HAPP_PATH, // preload
Expand All @@ -63,6 +61,7 @@ const prodOptions: ElectronHolochainOptions = {
keystorePath: KEYSTORE_PATH,
passphrase: 'test-passphrase',
bootstrapUrl: 'https://bootstrap.holo.host',
logging: 'Json',
}

export { devOptions, prodOptions }
36 changes: 24 additions & 12 deletions electron/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import {
app,
BrowserWindow,
ipcMain,
shell,
autoUpdater,
Menu,
} from 'electron'
import { app, BrowserWindow, ipcMain, shell, autoUpdater, Menu } from 'electron'
import * as contextMenu from 'electron-context-menu'
import * as path from 'path'
import * as fs from 'fs'
import initAgent, {
ERROR_EVENT,
StateSignal,
STATUS_EVENT,
HOLOCHAIN_LOG_EVENT,
WASM_LOG_EVENT,
} from '@lightningrodlabs/electron-holochain'

import { devOptions, prodOptions, stateSignalToText } from './holochain'
Expand Down Expand Up @@ -45,8 +41,6 @@ contextMenu.default({
showSaveImageAs: true,
})



// Handle creating/removing shortcuts on Windows when installing/uninstalling.
// if (require('electron-squirrel-startup')) {
// eslint-disable-line global-require
Expand Down Expand Up @@ -177,19 +171,37 @@ app.on('ready', async () => {
const splashWindow = createSplashWindow()
const opts = app.isPackaged ? prodOptions : devOptions
const { statusEmitter, shutdown } = await initAgent(app, opts, BINARY_PATHS)
let mainWindow: BrowserWindow | null = null
statusEmitter.on(STATUS_EVENT, (state: StateSignal) => {
switch (state) {
case StateSignal.IsReady:
// important that this line comes before the next one
// otherwise this triggers the 'all-windows-closed'
// event
createMainWindow()
mainWindow = createMainWindow()
splashWindow.close()
break
default:
splashWindow.webContents.send('status', stateSignalToText(state))
}
})
statusEmitter.on(ERROR_EVENT, (error: Error) => {
if (!error.message.includes('no project meta exists')) {
if (mainWindow) {
mainWindow.webContents.send('holochainError', error.message)
}
}
})
statusEmitter.on(HOLOCHAIN_LOG_EVENT, (log: string) => {
if (mainWindow) {
mainWindow.webContents.send('holochainLog', log)
}
})
statusEmitter.on(WASM_LOG_EVENT, (log: string) => {
if (mainWindow) {
mainWindow.webContents.send('wasmLog', log)
}
})
})

// Quit when all windows are closed, except on macOS. There, it's common
Expand Down Expand Up @@ -285,7 +297,7 @@ ipcMain.handle('checkForMigrationData', (event) => {
)
return {
file: existingMigrationPath,
data: prevVersionMigrationDataString
data: prevVersionMigrationDataString,
}
} else {
return null
Expand Down
5 changes: 3 additions & 2 deletions web/src/components/ButtonCheckbox/ButtonCheckbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
transition: 0.2s box-shadow ease;
-webkit-font-smoothing: antialiased;
user-select: none;
border: 0.15rem solid #ffffff00;
border: 0.15rem solid var(--border-color-button-checkbox);

&:hover,
&.focused {
&:focus {
box-shadow: 0rem 0rem 1.25rem var(--shadow-color-hover);
}

Expand Down Expand Up @@ -45,6 +45,7 @@

.button-checkbox-text {
user-select: none;
margin-right: 0.5rem;
/* Standard */
}
}
Expand Down
18 changes: 16 additions & 2 deletions web/src/components/ButtonCheckbox/ButtonCheckbox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import React, { useEffect } from 'react'
import Checkbox from '../Checkbox/Checkbox'
import Icon from '../Icon/Icon'

import './ButtonCheckbox.scss'

Expand All @@ -19,8 +18,23 @@ const ButtonCheckbox: React.FC<ButtonCheckboxProps> = ({
icon,
text,
}) => {
useEffect(() => {
// listen for Enter key to be pressed, but
// ignore if Command/Ctrl is also pressed
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === 'Enter' && !e.metaKey) {
onChange(!isChecked)
}
}
document.addEventListener('keydown', handleKeyDown)
return () => {
document.removeEventListener('keydown', handleKeyDown)
}
}, [isChecked, onChange])
return (
<div
role="button"
tabIndex={0}
className={`button-checkbox-wrapper ${isChecked ? 'selected' : ''} ${
size === 'tiny'
? 'tiny'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function ButtonWithPendingState({
}) {
return pending ? (
<span className="pending-acorn">
<Icon name="acorn-logo.svg" className="white not-hoverable very-small" />
<Icon name="acorn-logo.svg" className="not-hoverable" size="very-small"/>
<span>{pendingText}</span>
</span>
) : (
Expand Down
101 changes: 27 additions & 74 deletions web/src/components/CreateProjectModal/CreateProjectModal.scss
Original file line number Diff line number Diff line change
@@ -1,79 +1,32 @@
.create-project-modal-wrapper {
/* width: 550px; */
height: 523px;
overflow: hidden;
.create-project-modal {
width: 30rem;
overflow: auto;
position: relative;
justify-content: space-between;
align-items: center;
}

.create-project-modal-wrapper .validating-form-input {
margin-bottom: 28px;
}

.project-modal-content {
line-height: 1.45;
}

.create-project-image-row {
display: flex;
flex-direction: row;
align-items: flex-end;
}

.create-project-image-row .validating-form-input {
margin-bottom: 0;
}

.create-project-image {
margin-left: 8px;
width: 44px;
height: 44px;
background-size: cover;
background-repeat: no-repeat;
border-radius: 10px;
border: 2px solid #f3efeb;
box-sizing: border-box;
background-color: var(--bg-color-tertiary);
}

/* create project modal animation */

.create-project-form {
position: absolute;
opacity: 1;
transition: opacity 0.3s, transform 0.4s;
width: 420px;
}

.create-project-form.project-created {
/* background-color: blue; */
opacity: 0;
-webkit-transform: translateX(-300px);
transform: translateX(-300px);
}

/* project created modal animation */

/* default is to be hidden */

.project-created-modal {
/* position: absolute; */
opacity: 0;
-webkit-transform: scale(0.8);
transform: scale(0.8);
transition: opacity 0.3s, transform 0.4s;
}

/* then it shows */

.project-created-modal.project-created {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}

.project-created-modal.project-created .project-modal-content-spacer {
margin-bottom: 7rem;
margin-top: 3rem;
.create-project-form {

.create-project-image-row {
display: flex;
flex-direction: row;
align-items: flex-end;

.validating-form-input {
margin-bottom: 0;
}

.create-project-image {
margin-left: 8px;
width: 44px;
height: 44px;
background-size: cover;
background-repeat: no-repeat;
border-radius: 10px;
border: 2px solid #f3efeb;
box-sizing: border-box;
background-color: var(--bg-color-tertiary);
}
}
}
}
Loading
Loading