-
-
Notifications
You must be signed in to change notification settings - Fork 803
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add backend support for o-counter * Add o-counter buttons everywhere * Put o-counter button right-aligned on tabs * Add o-counter filter
- Loading branch information
1 parent
066295f
commit f87117b
Showing
22 changed files
with
325 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ fragment SlimSceneData on Scene { | |
url | ||
date | ||
rating | ||
o_counter | ||
path | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ fragment SceneData on Scene { | |
url | ||
date | ||
rating | ||
o_counter | ||
path | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE `scenes` ADD COLUMN `o_counter` tinyint not null default 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React, { FunctionComponent } from "react"; | ||
import { Button, Popover, Menu, MenuItem } from "@blueprintjs/core"; | ||
import { Icons } from "../../utils/icons"; | ||
|
||
export interface IOCounterButtonProps { | ||
loading: boolean | ||
value: number | ||
onIncrement: () => void | ||
onDecrement: () => void | ||
onReset: () => void | ||
onMenuOpened?: () => void | ||
onMenuClosed?: () => void | ||
} | ||
|
||
export const OCounterButton: FunctionComponent<IOCounterButtonProps> = (props: IOCounterButtonProps) => { | ||
function renderButton() { | ||
return ( | ||
<Button | ||
loading={props.loading} | ||
icon={Icons.sweatDrops()} | ||
text={props.value} | ||
minimal={true} | ||
onClick={props.onIncrement} | ||
disabled={props.loading} | ||
/> | ||
); | ||
} | ||
|
||
if (props.value) { | ||
// just render the button by itself | ||
return ( | ||
<Popover | ||
interactionKind={"hover"} | ||
hoverOpenDelay={1000} | ||
position="bottom" | ||
disabled={props.loading} | ||
onOpening={props.onMenuOpened} | ||
onClosing={props.onMenuClosed} | ||
> | ||
{renderButton()} | ||
<Menu> | ||
<MenuItem text="Decrement" icon="minus" onClick={props.onDecrement}/> | ||
<MenuItem text="Reset" icon="disable" onClick={props.onReset}/> | ||
</Menu> | ||
</Popover> | ||
); | ||
} else { | ||
return renderButton(); | ||
} | ||
} |
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.