-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split the webapp into components files
- Loading branch information
Showing
11 changed files
with
86 additions
and
66 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
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 |
---|---|---|
@@ -1,19 +1,20 @@ | ||
import React from "react"; | ||
import api from "./api.js"; | ||
|
||
// QueryLink can be used to make a direct link to a query search. The link is a | ||
// standard HTML link with a valid href, but the navigation is intercepted to | ||
// be handled by the app. This allow the user to copy-paste the link via his | ||
// navigator contextual menu, while making internal navigation easy. | ||
export default function QueryLink({ query, onClick }) { | ||
export default function QueryLink({ children, query, onClick }) { | ||
return ( | ||
<a | ||
href={`/?q=${encodeQuery({ q: query })}`} | ||
href={`/?q=${api.encodeQuery({ q: query })}`} | ||
onClick={(e) => { | ||
e.preventDefault(); | ||
onClick(); | ||
}} | ||
> | ||
{props.children} | ||
{children} | ||
</a> | ||
); | ||
} |
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,23 @@ | ||
@import "./colors.scss"; | ||
|
||
@mixin button { | ||
background: $background-light; | ||
border-color: $gray; | ||
border-radius: 0; | ||
border-style: solid; | ||
border-width: 1px; | ||
display: inline-block; | ||
padding: 0.5em; | ||
text-decoration: none; | ||
} | ||
|
||
@mixin button-focusable { | ||
&[active], | ||
&:focus { | ||
border-color: $primary; | ||
} | ||
|
||
&[dirty] { | ||
border-color: $secondary; | ||
} | ||
} |
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