-
Notifications
You must be signed in to change notification settings - Fork 16
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
IBX-2278: Added spinner to loading location meta data #320
IBX-2278: Added spinner to loading location meta data #320
Conversation
const creationDateLabel = Translator.trans(/*@Desc("Created")*/ 'meta_preview.creation_date', {}, 'universal_discovery_widget'); | ||
const translationsLabel = Translator.trans(/*@Desc("Translations")*/ 'meta_preview.translations', {}, 'universal_discovery_widget'); | ||
const renderMetaPreviewLoadingSpinner = () => { | ||
if (locationData && locationData.location && locationData.version) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this check is sufficient. If nothing is selected and there is no loading the spinner will be visible?
</> | ||
); | ||
}; | ||
const lastModifiedLabel = Translator.trans(/*@Desc("Last modified")*/ 'meta_preview.last_modified', {}, 'universal_discovery_widget'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these translation moved below lines where they're used?
); | ||
}; | ||
const renderMetaPreview = () => { | ||
if (!locationData || !locationData.location || !locationData.version) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe some additional func or move it above, as you used this kind of statement before (line 102)
const lastModifiedLabel = Translator.trans(/*@Desc("Last modified")*/ 'meta_preview.last_modified', {}, 'universal_discovery_widget'); | ||
const creationDateLabel = Translator.trans(/*@Desc("Created")*/ 'meta_preview.creation_date', {}, 'universal_discovery_widget'); | ||
const translationsLabel = Translator.trans(/*@Desc("Translations")*/ 'meta_preview.translations', {}, 'universal_discovery_widget'); | ||
const renderMetaPreviewLoadingSpinner = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this is inside ContentMetaPreview
it can be shortened:
const renderMetaPreviewLoadingSpinner = () => { | |
const renderLoadingSpinner = () => { |
12c38d1
to
d09612b
Compare
Checklist:
$ composer fix-cs
)