@citydna/experience v2.5.1
@citydna/experience
This package contains common code shared between the citydna-app-townhall-experience
and citydna-app-townhall-map
apps. There are many common functions & patterns between the two of them. They are centralised here:
AuthQRCode
A QR code generator that hooks into the Amplify API and generates auth tokens. These auth tokens are passed via URL in the QR code, along with other information such as experience, websocket channel, and the stack the user should join.
Avatar
An avatar that generally shows the icon and colour assigned to the anonymous user.
/common
This contains artifacts commo to the experiences and, such as websocket event names, icons used, and helper functions to parse data into the correct shape.
- icons
- aboriginal-melbourne-themes
- indigenous
These icons can be auto-converted to TypeScript react components by running the yarn build:icons
script when in this folder.
ConfigProvider
Provides config for a given experience based on the experience passed in the URL. Config for the apps are stored in the citydna-configs-bucket. These control things such as;
- what data/resources are displayed and used
- copy & translations for the apps, as well as custom images
- how the app displays on the user's phone
A local copy of these is kept in /apps/citydna-app-townhall-public/public/config
.
/hooks
useCardStack
- listens to websocket events and manages a queue of content to display.useConfig
- downloads and stores config, mainly used byConfigProvider
.useEsriModules
- a react-friendly wrapper foresri-loader
to load in arcgis-js modules.useFeatureLayers
- pass in feature layer URLs and get back esri FeatureLayer instances.useImage
- a flexible, lazy-loader for images that can handle IIIF, blurhashes, S3 and regular https image URLsuseLoadFullCard
- often just an ID is provided. This hook loads the remaining information for a card.useRandomFeature
- collates a list of IDs on a feature layer and randomly loads one of them.
PlatformSettings
Platform settings that are displayed on the CONTROLLER
iPad. They essentially tell the room which experience to display: 3d model, aboriginal-melbourne or state-library-images. These settings are pushed to the devices, and the devices know which content to show.
TourCard
The small card that pops up when a user taps a content item in citydna-app-townhall-*
apps.
TourCardStack
A managed stack of TourCards that uses useCardStack
to track and visualise content waiting in a queue.
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago