Fixed site loading in older versions of safari
This commit is contained in:
parent
b0fdabefcb
commit
a905ce378b
@ -1,11 +1,13 @@
|
||||
import React from "react";
|
||||
import { Image } from "theme-ui";
|
||||
|
||||
import { fromEntries } from "../helpers/shared";
|
||||
|
||||
// The data prop is used to pass data into the dom element
|
||||
// this can be used to pass state to the ProxyToken
|
||||
function Token({ image, className, data, sx }) {
|
||||
// Map the keys in data to have the `data-` prefix
|
||||
const dataProps = Object.fromEntries(
|
||||
const dataProps = fromEntries(
|
||||
Object.entries(data).map(([key, value]) => [`data-${key}`, value])
|
||||
);
|
||||
return (
|
||||
|
@ -8,3 +8,13 @@ export function omit(obj, keys) {
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
export function fromEntries(iterable) {
|
||||
if (Object.fromEntries) {
|
||||
return Object.fromEntries(iterable);
|
||||
}
|
||||
return [...iterable].reduce((obj, [key, val]) => {
|
||||
obj[key] = val;
|
||||
return obj;
|
||||
}, {});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user