Skip to content

Commit

Permalink
Added logged in templates scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpita-Jaiswal committed Nov 30, 2023
1 parent 688cfed commit 5bba07b
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 32 deletions.
4 changes: 4 additions & 0 deletions slides/assets/logout-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions slides/assets/logout.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions slides/assets/setting-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions slides/assets/setting.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions slides/assets/toggle-down-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions slides/assets/toggle-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions slides/assets/toggle-up-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions slides/assets/toggle-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 12 additions & 9 deletions slides/components/full-page.ftd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- import: fastn-community.github.io/dark-mode-switcher as dms



-- component page:
module site-data: site-data
module user-data: user-data
Expand Down Expand Up @@ -51,17 +52,19 @@ height.fixed.px: 32
-- ftd.row:
spacing.fixed.px: 32
align-content: center
;; if: { header.user-data.ud.is-logged-in }
if: { header.user-data.ud.is-logged-in }

-- button: Share
button-link: /
button-icon: $assets.files.slides.assets.share.svg

-- notification:

/-- avatar: $header.user-data.ud.user.name
email: $header.user-data.ud.user.email
if: { header.user-data.ud.user != NULL }
/-- ftd.text: $header.user-data.ud.ww.name
if: { header.user-data.ud.ww != NULL }

-- avatar: $header.user-data.ud.name
email: $header.user-data.ud.email

-- end: ftd.row

Expand Down Expand Up @@ -159,8 +162,8 @@ align-content: center
-- profile-circle: $avatar.title

-- ftd.image:
src: $assets.files.assets.toggle-down.svg
src if { avatar.pop-up }: $assets.files.assets.toggle-up.svg
src: $assets.files.slides.assets.toggle-down.svg
src if { avatar.pop-up }: $assets.files.slides.assets.toggle-up.svg
width.fixed.px: 24
height.fixed.px: 24

Expand Down Expand Up @@ -205,7 +208,7 @@ padding-vertical.px: 12
spacing.fixed.px: 8

-- ftd.image:
src: $assets.files.assets.setting.svg
src: $assets.files.slides.assets.setting.svg
width.fixed.px: 24
height.fixed.px: 24
align-self: center
Expand All @@ -221,7 +224,7 @@ width: fill-container
spacing.fixed.px: 8

-- ftd.image:
src: $assets.files.assets.logout.svg
src: $assets.files.slides.assets.logout.svg
width.fixed.px: 24
height.fixed.px: 24
align-self: center
Expand Down Expand Up @@ -310,6 +313,6 @@ color: white

-- string get-initials(name):
string name:
js: $assets.files.functions.js
js: $assets.files.slides.functions.js

get_initials(name)
7 changes: 7 additions & 0 deletions slides/functions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function get_initials(name) {
return name
.get("value")
.split(" ")
.map((p) => p[0])
.join("");
}
18 changes: 4 additions & 14 deletions slides/scenarios/john-doe-ud.ftd
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
-- record status:
boolean is-logged-in:
optional user-details user:

-- record user-details:
boolean is-logged-in:
string name:
string email:
string login:
integer id:
string username:


-- status ud:
-- user-details ud:
is-logged-in: true
user: $john


-- user-details john:
name: John Doe
email: john-doe@abc.com
login: john-doe
id: 1
username: john-doe
2 changes: 1 addition & 1 deletion slides/scenarios/logged-in-templates.ftd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- import: ui.fifthtry.com/slides/pages/templates
-- import: ui.fifthtry.com/slides/scenerios/john-doe-ud
-- import: ui.fifthtry.com/slides/scenarios/john-doe-ud


-- templates.page:
Expand Down
14 changes: 6 additions & 8 deletions slides/user-data.ftd
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
-- record status:
boolean is-logged-in:
optional user-details user:

-- record user-details:
boolean is-logged-in:
string name:
string email:
string login:
integer id:

string username:

-- status ud:
-- user-details ud:
is-logged-in: false
name: $ftd.empty
email: $ftd.empty
username: $ftd.empty

0 comments on commit 5bba07b

Please sign in to comment.