forked from stuffmatic/fSpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first sign of old ui built by new build process
- Loading branch information
1 parent
60a94b2
commit 3381bd7
Showing
50 changed files
with
997 additions
and
548 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,19 @@ | |
"author": "per <[email protected]>", | ||
"license": "GPL-3.0", | ||
"devDependencies": { | ||
"@types/highlight.js": "^9.12.3", | ||
"@types/jest": "^23.0.0", | ||
"@types/react": "^16.3.16", | ||
"@types/react-dom": "^16.0.5", | ||
"@types/react-measure": "^2.0.2", | ||
"@types/react-redux": "^6.0.1", | ||
"@types/react-select": "^1.2.6", | ||
"babel-core": "^6.26.3", | ||
"babel-loader": "^7.1.4", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-es2015-node": "^6.1.1", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"electron": "^2.0.2", | ||
"electron-builder": "^20.15.1", | ||
"html-webpack-plugin": "^3.2.0", | ||
|
@@ -37,7 +42,6 @@ | |
"build-dev": "webpack --config webpack.config.js --mode development", | ||
"prebuild-dist": "trash build", | ||
"build-dist": "webpack --config webpack.config.js --mode production", | ||
"predev-server": "yarn run build-dev", | ||
"predist": "yarn run build-dist", | ||
"predist-preview": "yarn run build-dist", | ||
"dist-preview": "electron-builder --dir", | ||
|
@@ -50,9 +54,12 @@ | |
"test": "jest" | ||
}, | ||
"dependencies": { | ||
"highlight.js": "^9.12.0", | ||
"react": "^16.4.0", | ||
"react-dom": "^16.4.0", | ||
"react-measure": "^2.0.2", | ||
"react-redux": "^5.0.7", | ||
"react-select": "^1.2.1", | ||
"redux": "^4.0.0", | ||
"redux-thunk": "^2.3.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React from 'react' | ||
import ImageContainer from './containers/image-container' | ||
import ResultContainer from './containers/result-container' | ||
import SettingsContainer from './containers/settings-container' | ||
import ExportDialog from './components/export-dialog/export-dialog' | ||
|
||
// import './App.css' | ||
import { StoreState } from './types/store-state' | ||
import { Dispatch, connect } from 'react-redux' | ||
import { AppAction, setExportDialogVisibility } from './actions' | ||
import { GlobalSettings, CalibrationMode } from './types/global-settings' | ||
import { UIState } from './types/ui-state' | ||
import CalibrationResult from './types/calibration-result' | ||
import { ImageState } from './types/image-state' | ||
|
||
interface AppProps { | ||
uiState: UIState, | ||
globalSettings: GlobalSettings, | ||
calibrationResult: CalibrationResult, | ||
image: ImageState, | ||
onExportDialogVisiblityChange(isVisible: boolean): void | ||
} | ||
|
||
function App(props: AppProps) { | ||
return ( | ||
|
||
<div id='app-container'> | ||
<ExportDialog | ||
isVisible={props.uiState.isExportDialogOpen} | ||
solverResult={props.globalSettings.calibrationMode == CalibrationMode.OneVanishingPoint ? props.calibrationResult.calibrationResult1VP : props.calibrationResult.calibrationResult2VP} | ||
image={props.image} | ||
onOpen={() => props.onExportDialogVisiblityChange(true)} | ||
onClose={() => props.onExportDialogVisiblityChange(false)} | ||
/> | ||
<SettingsContainer isVisible={props.uiState.sidePanelsAreVisible} /> | ||
<ImageContainer /> | ||
<ResultContainer isVisible={props.uiState.sidePanelsAreVisible} /> | ||
</div> | ||
) | ||
} | ||
|
||
export function mapStateToProps(state: StoreState) { | ||
return { | ||
uiState: state.uiState, | ||
globalSettings: state.globalSettings, | ||
calibrationResult: state.calibrationResult, | ||
image: state.image | ||
} | ||
} | ||
|
||
export function mapDispatchToProps(dispatch: Dispatch<AppAction>) { | ||
return { | ||
onExportDialogVisiblityChange: (isVisible: boolean) => { | ||
dispatch(setExportDialogVisibility(isVisible)) | ||
} | ||
} | ||
} | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(App) |
22 changes: 11 additions & 11 deletions
22
_old/src/components/common/button.tsx → src/gui/components/common/button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import * as React from 'react'; | ||
import { Palette } from '../../style/palette'; | ||
import * as React from 'react' | ||
import { Palette } from '../../style/palette' | ||
|
||
interface ButtonProps { | ||
title: string | ||
onClick(): void | ||
fillWidth?: boolean | ||
isSelected?:boolean | ||
isSelected?: boolean | ||
onClick(): void | ||
} | ||
|
||
export default function Button(props: ButtonProps) { | ||
|
||
let style = { | ||
minWidth: "90px", | ||
height: "25px", | ||
minWidth: '90px', | ||
height: '25px', | ||
backgroundColor: props.isSelected ? Palette.white : Palette.gray, | ||
outline: "none", | ||
border: "none", | ||
boxShadow: "none" | ||
outline: 'none', | ||
border: 'none', | ||
boxShadow: 'none' | ||
} | ||
|
||
if (props.fillWidth === true) { | ||
(style as any).width = "100%"; | ||
(style as any).width = '100%' | ||
} | ||
|
||
return ( | ||
<button style={style} onClick={() => props.onClick()}> | ||
{props.title} | ||
</button> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.