(this.browserDiv = r)}
@@ -552,6 +738,7 @@ class MediaBrowserContainer extends Component {
onEdit={onEdit}
onShowSimilar={onShowSimilar}
onCopy={onCopy}
+ premium={this.state.premiums[entry.id]}
/>
);
})}
diff --git a/src/react-components/profile-entry-panel.js b/src/react-components/profile-entry-panel.js
index 242009809e..2968d72c54 100644
--- a/src/react-components/profile-entry-panel.js
+++ b/src/react-components/profile-entry-panel.js
@@ -96,6 +96,10 @@ export default class ProfileEntryPanel extends Component {
this.scene.addEventListener("action_avatar_saved", this.refetchAvatar);
this.refetchAvatar();
+ // show avatar picker immediately in entry flow
+ if (this.props.containerType !== "sidebar") {
+ this.props.mediaSearchStore.sourceNavigateWithNoNav("avatars", "use");
+ }
}
componentDidUpdate(_prevProps, prevState) {
diff --git a/src/react-components/room/MediaTiles.js b/src/react-components/room/MediaTiles.js
index 4d88d7edcd..eba92a1f7f 100644
--- a/src/react-components/room/MediaTiles.js
+++ b/src/react-components/room/MediaTiles.js
@@ -17,6 +17,8 @@ const PUBLISHER_FOR_ENTRY_TYPE = {
twitch_stream: "Twitch"
};
+const prices = [0, 1, 3, 5];
+
function useThumbnailSize(isImage, isAvatar, imageAspect) {
return useMemo(
() => {
@@ -128,7 +130,17 @@ CreateTile.propTypes = {
type: PropTypes.string
};
-export function MediaTile({ entry, processThumbnailUrl, onClick, onEdit, onShowSimilar, onCopy, onInfo, ...rest }) {
+export function MediaTile({
+ entry,
+ processThumbnailUrl,
+ onClick,
+ onEdit,
+ onShowSimilar,
+ onCopy,
+ onInfo,
+ premium,
+ ...rest
+}) {
const intl = useIntl();
const creator = entry.attributions && entry.attributions.creator;
const publisherName =
@@ -202,6 +214,7 @@ export function MediaTile({ entry, processThumbnailUrl, onClick, onEdit, onShowS
{entry.member_count}
)}
+ {premium &&
${prices[premium]}
}
{entry.type === "avatar" && (
* {
margin-bottom: 4px;
}
diff --git a/src/storage/store.js b/src/storage/store.js
index e4f92a4454..1ff0d77b8b 100644
--- a/src/storage/store.js
+++ b/src/storage/store.js
@@ -56,7 +56,8 @@ export const SCHEMA = {
additionalProperties: false,
properties: {
token: { type: ["null", "string"] },
- email: { type: ["null", "string"] }
+ email: { type: ["null", "string"] },
+ purchasedAvatars: { type: ["null", "object"] }
}
},
@@ -231,7 +232,11 @@ export default class Store extends EventTarget {
});
this.update({
- activity: {},
+ activity: {
+ // always show name & avatar picker
+ hasAcceptedProfile: false,
+ hasChangedName: false
+ },
settings: {},
credentials: {},
profile: {},
diff --git a/src/systems/exit-on-blur.js b/src/systems/exit-on-blur.js
index c224055387..a83461ffa0 100644
--- a/src/systems/exit-on-blur.js
+++ b/src/systems/exit-on-blur.js
@@ -29,6 +29,7 @@ AFRAME.registerSystem("exit-on-blur", {
if (
this.isOculusBrowser &&
this.enteredVR &&
+ !this.el.is("payment-authorizing") &&
(this.lastTimeoutCheck === 0 || t - this.lastTimeoutCheck >= 1000.0) // Don't do this clear every frame, slow.
) {
this.lastTimeoutCheck = t;
@@ -42,7 +43,7 @@ AFRAME.registerSystem("exit-on-blur", {
},
onBlur() {
- if (this.el.isMobile) {
+ if (this.el.isMobile && !this.el.is("payment-authorizing")) {
clearTimeout(this.exitTimeout);
this.exitTimeout = setTimeout(this.onTimeout, 30 * 1000);
}
diff --git a/src/utils/configs.js b/src/utils/configs.js
index cec4bf3572..f3363f3f5e 100644
--- a/src/utils/configs.js
+++ b/src/utils/configs.js
@@ -17,7 +17,10 @@ let isAdmin = false;
"GA_TRACKING_ID",
"SHORTLINK_DOMAIN",
"BASE_ASSETS_PATH",
- "UPLOADS_HOST"
+ "UPLOADS_HOST",
+ "STRIPE_CHECKOUT_SESSION_URL",
+ "STRIPE_VERIFY_RECEIPT_URL",
+ "PAYMENTS_API_KEY"
].forEach(x => {
const el = document.querySelector(`meta[name='env:${x.toLowerCase()}']`);
configs[x] = el ? el.getAttribute("content") : process.env[x];
diff --git a/webpack.config.js b/webpack.config.js
index e77c8a6409..68796535ae 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -646,6 +646,9 @@ module.exports = async (env, argv) => {
POSTGREST_SERVER: process.env.POSTGREST_SERVER,
UPLOADS_HOST: process.env.UPLOADS_HOST,
BASE_ASSETS_PATH: process.env.BASE_ASSETS_PATH,
+ STRIPE_CHECKOUT_SESSION_URL: process.env.STRIPE_CHECKOUT_SESSION_URL,
+ STRIPE_VERIFY_RECEIPT_URL: process.env.STRIPE_VERIFY_RECEIPT_URL,
+ PAYMENTS_API_KEY: process.env.PAYMENTS_API_KEY,
APP_CONFIG: appConfig
})
})