Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: adapt settings for mobile (UI) #1636

Closed
wants to merge 38 commits into from

Conversation

begonaalvarezd
Copy link
Member

@begonaalvarezd begonaalvarezd commented Nov 18, 2021

Description of change

⚠️ Depends on #2155, this PR will be reopen when that one gets merged to develop

Make UI relevant changes to adapt the settings to mobile.

Things to note:

  • Drawer component has been refactored to appear only onMount and disappear onDestroy
  • Drawer component has been adapted to fit the features of the popup component, the drawer component replaces the popup component in mobile, except for fullScreen popups
  • Settings has been refactored in general so the code of each section is in an standalone file

TODOs:

Links to any relevant issues

N/A

Type of change

  • Update (a change which updates existing functionality)

How the change has been tested

You can test from packages/desktop changing:

  • In packages/desktop/App.svelte
import { mobile } from 'shared/lib/app'
mobile.set(true)
  • In packages/desktop/App.svelte move the popup component to be placed right before the Toast Container
...

{#if settings}
    <Settings locale={$_} handleClose={() => (settings = false)} />
{/if}

{#if $popupState.active}
    <Popup
        type={$popupState.type}
        props={$popupState.props}
        hideClose={$popupState.hideClose}
        fullScreen={$popupState.fullScreen}
        transition={$popupState.transition}
        locale={$_}
    />
{/if}

<ToastContainer />

...
  • In packages/shared/lib/router.ts force to login using the following script:
const profileId = 'XXXXXXXXXXXXXXXXXXXXXXXX';
const profileName = 'XXXXXX'
const profilePin = 'XXXXXX'
setActiveProfile(profileId)
Platform.PincodeManager.verify(profileId, profilePin)
    .then((verified) => {
        if (verified === true) {
            return Electron.getUserDataPath().then((path) => {
                initialise(profileId, getStoragePath(path, profileName))
                api.setStoragePassword(profilePin, {
                    onSuccess() {
                        login()
                        setRoute(AppRoute.Welcome)
                    },
                    onError(err) {
                        console.error(err)
                    },
                })
            })
        }
    })
    .catch((error) => {
        console.error(error)
    })

⚠️ Please beware in desktop the scrollbars are not the same as in mobile, in desktop they take space they dont in mobile

Change checklist

Add an x to the boxes that are relevant to your changes, and delete any items that are not.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that my latest changes pass CI tests
  • New and existing unit tests pass locally with my changes

@begonaalvarezd begonaalvarezd marked this pull request as ready for review January 13, 2022 12:44
@begonaalvarezd begonaalvarezd marked this pull request as draft January 18, 2022 10:24
@begonaalvarezd
Copy link
Member Author

Closing PR because it has been divided in 3: #2250, #2251 & #2271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature Adding a new feature or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants