-
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.
- Loading branch information
1 parent
9ff3e5c
commit 4de189a
Showing
9 changed files
with
199 additions
and
11 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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
Package: signature.r | ||
Title: Fill your email signature | ||
Version: 0.0.0.9000 | ||
Authors@R: person('Arthur', 'Bréant', email = '[email protected]', role = c('cre', 'aut')) | ||
Authors@R: | ||
person("Arthur", "Bréant", , "[email protected]", role = c("cre", "aut")) | ||
Description: Fill in your email signature from Thinkr template. | ||
License: MIT + file LICENSE | ||
URL: https://github.com/ThinkR-open/signature.r | ||
BugReports: https://github.com/ThinkR-open/signature.r/issues | ||
Imports: | ||
bslib, | ||
config (>= 0.3.2), | ||
golem (>= 0.4.1), | ||
sass, | ||
shiny (>= 1.9.1) | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 7.3.2 | ||
URL: https://github.com/ThinkR-open/signature.r | ||
BugReports: https://github.com/ThinkR-open/signature.r/issues | ||
Suggests: | ||
spelling, | ||
testthat (>= 3.0.0) | ||
Config/testthat/edition: 3 | ||
Encoding: UTF-8 | ||
Language: en-US | ||
LazyData: true | ||
RoxygenNote: 7.3.2 |
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,42 @@ | ||
#' navbar UI Function | ||
#' | ||
#' @description A shiny Module. | ||
#' | ||
#' @param id,input,output,session Internal parameters for {shiny}. | ||
#' | ||
#' @noRd | ||
#' | ||
#' @importFrom shiny NS tagList | ||
#' @importFrom bslib input_dark_mode | ||
mod_navbar_ui <- function(id) { | ||
ns <- NS(id) | ||
tagList( | ||
tags$nav( | ||
class = "navbar navbar-light bg-transparent", | ||
div( | ||
class = "container-fluid", | ||
a( | ||
class = "navbar-brand", | ||
href = "/", | ||
"Signature.r" | ||
), | ||
input_dark_mode() | ||
) | ||
) | ||
) | ||
} | ||
|
||
#' navbar Server Functions | ||
#' | ||
#' @noRd | ||
mod_navbar_server <- function(id) { | ||
moduleServer(id, function(input, output, session) { | ||
ns <- session$ns | ||
}) | ||
} | ||
|
||
## To be copied in the UI | ||
# mod_navbar_ui("navbar") | ||
|
||
## To be copied in the server | ||
# mod_navbar_server("navbar) |
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,12 @@ | ||
path.n: NAMESPACE | ||
path.d: DESCRIPTION | ||
dir.r: R | ||
dir.v: vignettes | ||
dir.t: tests | ||
extra.suggests: ~ | ||
pkg_ignore: ~ | ||
document: yes | ||
normalize: yes | ||
inside_rmd: no | ||
must.exist: yes | ||
check_if_suggests_is_installed: yes |
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,69 @@ | ||
@import url("https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap"); | ||
@import url("https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Permanent+Marker&display=swap"); | ||
|
||
$info: #494955; | ||
$close: #ff5f57; | ||
$minimize: #febc2e; | ||
$zoom: #27c840; | ||
|
||
body { | ||
font-family: "Lato", sans-serif; | ||
} | ||
|
||
.navbar { | ||
padding: 1.5em 0; | ||
|
||
.navbar-brand { | ||
font-size: 1.5em; | ||
font-family: "Permanent Marker", cursive; | ||
pointer-events: none; | ||
color: $secondary; | ||
} | ||
} | ||
|
||
body { | ||
font-family: "Lato", sans-serif; | ||
} | ||
|
||
.navbar { | ||
padding: 1.5em 0; | ||
|
||
.navbar-brand { | ||
font-size: 1.5em; | ||
font-family: "Permanent Marker", cursive; | ||
pointer-events: none; | ||
color: $secondary; | ||
} | ||
} | ||
|
||
.buttons { | ||
display: flex; | ||
align-items: center; | ||
grid-gap: 7px; | ||
height: 20px; | ||
} | ||
|
||
.buttons-default { | ||
width: 11px; | ||
height: 11px; | ||
border-radius: 50%; | ||
display: inline-block; | ||
} | ||
|
||
.close { | ||
@extend .buttons-default; | ||
background: $close; | ||
border: 1px solid $close; | ||
} | ||
|
||
.minimize { | ||
@extend .buttons-default; | ||
background: $minimize; | ||
border: 1px solid $minimize; | ||
} | ||
|
||
.zoom { | ||
@extend .buttons-default; | ||
background: $zoom; | ||
border: 1px solid $zoom; | ||
} |
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,38 @@ | ||
testServer( | ||
mod_navbar_server, | ||
# Add here your module params | ||
args = list() | ||
, { | ||
ns <- session$ns | ||
expect_true( | ||
inherits(ns, "function") | ||
) | ||
expect_true( | ||
grepl(id, ns("")) | ||
) | ||
expect_true( | ||
grepl("test", ns("test")) | ||
) | ||
# Here are some examples of tests you can | ||
# run on your module | ||
# - Testing the setting of inputs | ||
# session$setInputs(x = 1) | ||
# expect_true(input$x == 1) | ||
# - If ever your input updates a reactiveValues | ||
# - Note that this reactiveValues must be passed | ||
# - to the testServer function via args = list() | ||
# expect_true(r$x == 1) | ||
# - Testing output | ||
# expect_true(inherits(output$tbl$html, "html")) | ||
}) | ||
|
||
test_that("module ui works", { | ||
ui <- mod_navbar_ui(id = "test") | ||
golem::expect_shinytaglist(ui) | ||
# Check that formals have not been removed | ||
fmls <- formals(mod_navbar_ui) | ||
for (i in c("id")){ | ||
expect_true(i %in% names(fmls)) | ||
} | ||
}) | ||
|