-
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42d44f1
commit f238a92
Showing
30 changed files
with
274 additions
and
127 deletions.
There are no files selected for viewing
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
37 changes: 37 additions & 0 deletions
37
packages/metastream-app/src/components/chat/ChatLayoutButton.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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as React from 'react' | ||
import styles from './PanelHeader.css' | ||
import { useDispatch, useSelector } from 'react-redux' | ||
import { setSetting } from 'actions/settings' | ||
import { ChatLocation } from './Location' | ||
import { IAppState } from 'reducers' | ||
import { t } from 'locale' | ||
import { IconButton } from 'components/common/button' | ||
|
||
interface Props { | ||
className?: string | ||
} | ||
|
||
export const ChatLayoutButton: React.SFC<Props> = ({ className }) => { | ||
const dispatch = useDispatch() | ||
|
||
const chatLocation = useSelector<IAppState>(state => state.settings.chatLocation) | ||
const isFloating = chatLocation === ChatLocation.FloatLeft | ||
|
||
function toggleChatLayout() { | ||
dispatch( | ||
setSetting('chatLocation', location => | ||
location === ChatLocation.DockRight ? ChatLocation.FloatLeft : ChatLocation.DockRight | ||
) | ||
) | ||
} | ||
|
||
return ( | ||
<IconButton | ||
icon={isFloating ? 'dock-right' : 'undock-float'} | ||
iconSize="small" | ||
className={className} | ||
onClick={toggleChatLayout} | ||
title={t(isFloating ? 'uiDockToRight' : 'uiUndock')} | ||
/> | ||
) | ||
} |
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
36 changes: 36 additions & 0 deletions
36
packages/metastream-app/src/components/lobby/PanelHeader.css
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,36 @@ | ||
.header { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
padding: 10px; | ||
flex-wrap: nowrap; | ||
} | ||
|
||
.title { | ||
composes: single-line from '~styles/text.css'; | ||
font-weight: bold; | ||
text-transform: uppercase; | ||
letter-spacing: 2px; | ||
margin-right: 5px; | ||
text-overflow: clip; | ||
} | ||
|
||
.tagline { | ||
border: 1px solid rgba(255, 255, 255, 0.22); | ||
padding: 2px 4px; | ||
font-size: 12px; | ||
min-width: 18px; | ||
text-align: center; | ||
} | ||
|
||
.actions { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
flex-wrap: nowrap; | ||
margin-left: auto; | ||
} | ||
|
||
.actions > *:not(:last-child) { | ||
margin-right: 0.5rem; | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/metastream-app/src/components/lobby/PanelHeader.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as React from 'react' | ||
import styles from './PanelHeader.css' | ||
|
||
interface Props { | ||
title?: string | ||
tagline?: string | ||
action?: React.ReactNode | ||
} | ||
|
||
export const PanelHeader: React.SFC<Props> = ({ title, tagline, action }) => { | ||
return ( | ||
<header className={styles.header}> | ||
<h2 className={styles.title}>{title}</h2> | ||
{tagline && <span className={styles.tagline}>{tagline}</span>} | ||
<div className={styles.actions}>{action}</div> | ||
</header> | ||
) | ||
} |
Oops, something went wrong.