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

chore(uve): Add Device Selector functionality #30903

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

zJaaal
Copy link
Contributor

@zJaaal zJaaal commented Dec 10, 2024

WIP

@zJaaal zJaaal linked an issue Dec 10, 2024 that may be closed by this pull request
@zJaaal zJaaal requested review from rjvelazco, fmontes and KevinDavilaDotCMS and removed request for rjvelazco December 13, 2024 15:35
@@ -140,6 +140,19 @@ export function withEditor() {
const origin = params.clientHost || window.location.origin;
const iframeURL = new URL(pageAPIQueryParams, origin);

const unit = device?.inode !== 'default' ? BASE_IFRAME_MEASURE_UNIT : '%';

const wrapper =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be a function? is a little difficult to read

},
actionIcon: 'pi pi-times'
};
} else if (!getIsDefaultVariant(pageAPIResponse?.viewAs.variantId)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the else is not necessary i think


// So we dont open the editor in a device
if (!this.#store.$isPreviewMode() && (deviceInode || orientation)) {
this.#store.patchViewParams({ device: null, orientation: null });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this generate a loop any time?
Maybe it should be in an untracked()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it doesn't but I haven't tested this code properly, so Im sure this can be better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FTM: Preview Mode- Implement Device views
2 participants