UNPKG

@wener/console

Version:
120 lines (119 loc) 4.75 kB
function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _object_spread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _define_property(target, key, source[key]); }); } return target; } function _object_without_properties(source, excluded) { if (source == null) return {}; var target = {}, sourceKeys, key, i; if (typeof Reflect !== "undefined" && Reflect.ownKeys) { sourceKeys = Reflect.ownKeys(source); for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } return target; } target = _object_without_properties_loose(source, excluded); if (Object.getOwnPropertySymbols) { sourceKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _object_without_properties_loose(source, excluded) { if (source == null) return {}; var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } return target; } import React from "react"; import { clsx } from "clsx"; import { WechatBrandIcon, WecomBrandIcon } from "../../icons/index.js"; import { cn } from "../../utils/cn.js"; export var LoginPageSocialLogin = function (_0) { var socials = _0.socials, className = _0.className, props = _object_without_properties(_0, [ "socials", "className" ]); if (!socials || socials.length === 0) { return null; } return /*#__PURE__*/ React.createElement("div", _object_spread({ className: cn("mt-10", className) }, props), /*#__PURE__*/ React.createElement("div", { className: "relative" }, /*#__PURE__*/ React.createElement("div", { className: "absolute inset-0 flex items-center", "aria-hidden": "true" }, /*#__PURE__*/ React.createElement("div", { className: "w-full border-t border-gray-200" })), /*#__PURE__*/ React.createElement("div", { className: "relative flex justify-center text-sm leading-6 font-medium" }, /*#__PURE__*/ React.createElement("span", { className: "bg-white px-6 opacity-80" }, "\u793E\u4EA4\u65B9\u5F0F\u767B\u5F55"))), /*#__PURE__*/ React.createElement("div", { className: "mt-6 grid grid-cols-2 gap-4" }, socials.map(function (social, index) { return /*#__PURE__*/ React.createElement("button", { key: index, type: "button", onClick: social.onClick, className: clsx("btn btn-sm rounded-md") }, social.icon || social.name === "Wechat" && /*#__PURE__*/ React.createElement(WechatBrandIcon, { className: "h-4 w-4" }), social.name === "Wechat" && !social.icon && /*#__PURE__*/ React.createElement("span", { className: "text-sm leading-6 font-semibold" }, "Wechat"), social.name === "Wecom" && !social.icon && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(WecomBrandIcon, { className: "h-4 w-4" }), /*#__PURE__*/ React.createElement("span", { className: "text-sm leading-6 font-semibold" }, "\u4F01\u4E1A\u5FAE\u4FE1")), social.icon && /*#__PURE__*/ React.createElement("span", { className: "text-sm leading-6 font-semibold" }, social.name)); }))); };