-
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.
feat(app): improve application UI, docs
- Loading branch information
Showing
22 changed files
with
198 additions
and
43 deletions.
There are no files selected for viewing
Binary file not shown.
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,2 @@ | ||
.root { | ||
} |
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,9 @@ | ||
import { FunctionComponent } from 'react'; | ||
import { Property } from 'kefir'; | ||
|
||
export interface Props { | ||
name: Property<string, any>; | ||
editing: Property<boolean, any>; | ||
} | ||
|
||
export interface Component extends FunctionComponent<Props> {} |
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,35 @@ | ||
/** | ||
* @module ImageName | ||
* @namespace components.layout.Header._ | ||
*/ | ||
import * as React from 'karet'; | ||
import * as U from 'karet.util'; | ||
import * as R from 'kefir.ramda'; | ||
|
||
import * as T from './index.d'; | ||
import styles from './index.module.scss'; | ||
|
||
/** | ||
* @param {T.Props} props | ||
* @return {T.Component} | ||
*/ | ||
function ImageName({ name, isEditing }) { | ||
const toggleFlag = U.doModify(isEditing, R.not); | ||
|
||
return ( | ||
<div className={styles.root}> | ||
{U.stringify({ isEditing })} | ||
{U.ifElse( | ||
isEditing, | ||
<div> | ||
<U.Input value={name} /> | ||
</div>, | ||
<span className={styles.nameLabel} onClick={toggleFlag}> | ||
{name} | ||
</span>, | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default ImageName; |
11 changes: 11 additions & 0 deletions
11
src/components/layout/Header/_/ImageName/index.module.scss
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,11 @@ | ||
.root { | ||
} | ||
|
||
.nameLabel { | ||
border-bottom: dotted 1px #f00; | ||
text-decoration: dotted underline #00f; | ||
cursor: pointer; | ||
background: rgba(0, 0, 0, 0.2); | ||
display: inline-block; | ||
padding: 0.1rem 0.2rem; | ||
} |
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,10 @@ | ||
import { FunctionComponent } from 'react'; | ||
import { IMenuItem } from '../../../core/models'; | ||
|
||
export interface Props { | ||
menuItems: IMenuItem[]; | ||
name: string; | ||
isEditing: boolean; | ||
} | ||
|
||
export interface Component extends FunctionComponent<Props> {} |
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,33 @@ | ||
/* eslint no-unused-vars: [1, {"varsIgnorePattern": "[K|T|Model]"}] */ | ||
import * as React from 'karet'; | ||
import * as U from 'karet.util'; | ||
|
||
import Menu from '../../ui/Menu'; | ||
import ImageName from './_/ImageName'; | ||
|
||
import * as T from './index.d'; | ||
import styles from './index.module.scss'; | ||
|
||
import logo from '../../../assets/logo.svg'; | ||
|
||
/** | ||
* @type {T.Props} props | ||
* @return {T.Component} | ||
*/ | ||
function Header({ menuItems, className, name, isEditing }) { | ||
return ( | ||
<header className={U.cns(styles.root, className)}> | ||
<div className={styles.logoWrapper}> | ||
<img className={styles.logo} src={logo} /> | ||
</div> | ||
|
||
<div className={styles.wrapper}> | ||
<Menu items={menuItems} /> | ||
|
||
<ImageName {...{ name, isEditing }} /> | ||
</div> | ||
</header> | ||
); | ||
} | ||
|
||
export default Header; |
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,26 @@ | ||
.root { | ||
overflow: hidden; | ||
display: grid; | ||
grid-template-columns: 5rem auto; | ||
} | ||
|
||
.wrapper { | ||
display: grid; | ||
grid-template-columns: 1fr auto 1fr; | ||
} | ||
|
||
.logoWrapper { | ||
// border: solid 3px #f00; | ||
height: 100%; | ||
// width: 4rem; | ||
position: relative; | ||
} | ||
|
||
.logo { | ||
// border: solid 1px #f00; | ||
max-width: 100%; | ||
position: absolute; | ||
top: 50%; | ||
left: 0.5rem; | ||
transform: rotateZ(-20deg) translateY(-50%); | ||
} |
Empty file.
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
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
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
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
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
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
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