126 lines
5.3 KiB
TypeScript
126 lines
5.3 KiB
TypeScript
// Module ID: 13403
|
|
// Function ID: 13404
|
|
// Name: ShinyButton
|
|
// Dependencies: [32, 19, 17, 4336, 21, 4344, 589, 4083, 4345, 1300, 2]
|
|
// Exports: default
|
|
|
|
// Module 13403 (ShinyButton)
|
|
import _slicedToArray from "_slicedToArray";
|
|
import noop from "noop";
|
|
import { AppState } from "get ActivityIndicator";
|
|
import maybeApplyNoTextColorForLightCustomTheme from "maybeApplyNoTextColorForLightCustomTheme";
|
|
import { jsx } from "jsxProd";
|
|
import createCacheKey from "createCacheKey";
|
|
|
|
const require = arg1;
|
|
let items = [{ rotate: "30deg" }];
|
|
let closure_8 = createCacheKey.createStyles({ shinyButton: { overflow: "hidden" }, shineContainer: { width: "100%", height: "100%", position: "absolute", overflow: "hidden" }, shine: { width: 56, height: "500%", transform: items, backgroundColor: "rgba(255,255,255,0.1)", top: "-100%", alignItems: "center" }, shineInner: { width: 16, height: "100%", backgroundColor: "rgba(255,255,255,0.1)" } });
|
|
let closure_9 = { code: "function ShinyButtonTsx1(){const{width,OFFSCREEN_OFFSET,withRepeat,withSequence,withTiming,withDelay,INITIAL_ANIMATION_DELAY,ANIMATION_DURATION}=this.__closure;if(width==null){return{transform:[{translateX:-OFFSCREEN_OFFSET}]};}return{transform:[{translateX:withRepeat(withSequence(withTiming(-OFFSCREEN_OFFSET,{duration:0},'animate-always'),withDelay(INITIAL_ANIMATION_DELAY,withTiming(width+OFFSCREEN_OFFSET,{duration:ANIMATION_DURATION},'animate-always'))),-1)}]};}" };
|
|
const result = require("get ActivityIndicator").fileFinishedImporting("design/void/ShinyButton/native/ShinyButton.tsx");
|
|
|
|
export default function ShinyButton(disabled) {
|
|
let c10;
|
|
let c9;
|
|
let _slicedToArray;
|
|
let noop;
|
|
let importDefault;
|
|
let shineDisabled;
|
|
disabled = disabled.disabled;
|
|
({ submitting: importDefault, shineDisabled } = disabled);
|
|
if (shineDisabled === undefined) {
|
|
shineDisabled = false;
|
|
}
|
|
({ shineStyle: _slicedToArray, shineInnerStyle: noop } = disabled);
|
|
const merged = Object.assign(disabled, Object.create(null));
|
|
let AppState;
|
|
let first;
|
|
let jsx;
|
|
let callback2;
|
|
c9 = undefined;
|
|
c10 = undefined;
|
|
let closure_11;
|
|
function handleLayout(nativeEvent) {
|
|
callback(nativeEvent.nativeEvent.layout.width);
|
|
}
|
|
const tmp2 = callback2();
|
|
AppState = tmp2;
|
|
const tmp3 = callback(React.useState(null), 2);
|
|
first = tmp3[0];
|
|
jsx = tmp3[1];
|
|
let obj = disabled(shineDisabled[6]);
|
|
let items = [first];
|
|
callback2 = obj.useStateFromStores(items, () => first.useReducedMotion, []);
|
|
[c9, c10] = callback(React.useState("active" === AppState.currentState), 2);
|
|
const effect = React.useEffect(() => {
|
|
let closure_0 = _undefined.addEventListener("change", (arg0) => {
|
|
callback("active" === arg0);
|
|
});
|
|
return () => {
|
|
closure_0.remove();
|
|
};
|
|
}, []);
|
|
const tmp5 = callback(React.useState("active" === AppState.currentState), 2);
|
|
const fn = function p() {
|
|
if (null == first) {
|
|
let obj = { transform: null };
|
|
const items = [{ translateX: -100 }];
|
|
obj[0] = items;
|
|
} else {
|
|
obj = { transform: null };
|
|
obj = { translateX: null };
|
|
const obj4 = disabled(shineDisabled[7]);
|
|
const obj5 = disabled(shineDisabled[7]);
|
|
const obj6 = disabled(shineDisabled[8]);
|
|
const withTimingResult = disabled(shineDisabled[8]).withTiming(-100, { duration: 0 }, "animate-always");
|
|
const obj7 = disabled(shineDisabled[7]);
|
|
obj[0] = obj4.withRepeat(obj5.withSequence(withTimingResult, obj7.withDelay(750, disabled(shineDisabled[8]).withTiming(tmp + 100, { duration: 2000 }, "animate-always"))), -1);
|
|
const items1 = [obj];
|
|
obj[0] = items1;
|
|
const obj8 = disabled(shineDisabled[8]);
|
|
}
|
|
return obj;
|
|
};
|
|
obj = { width: first, OFFSCREEN_OFFSET: 100, withRepeat: disabled(shineDisabled[7]).withRepeat, withSequence: disabled(shineDisabled[7]).withSequence, withTiming: disabled(shineDisabled[8]).withTiming, withDelay: disabled(shineDisabled[7]).withDelay, INITIAL_ANIMATION_DELAY: 750, ANIMATION_DURATION: 2000 };
|
|
fn.__closure = obj;
|
|
fn.__workletHash = 5550564727650;
|
|
fn.__initData = c9;
|
|
closure_11 = disabled(shineDisabled[7]).useAnimatedStyle(fn);
|
|
obj = {};
|
|
const obj2 = disabled(shineDisabled[7]);
|
|
const merged1 = Object.assign(merged);
|
|
let items1 = [disabled.style, tmp2.shinyButton];
|
|
obj.style = items1;
|
|
obj.disabled = disabled;
|
|
obj.renderShine = function renderShine() {
|
|
let tmp = null;
|
|
if (!disabled) {
|
|
tmp = null;
|
|
if (!closure_1) {
|
|
tmp = null;
|
|
if (!closure_8) {
|
|
tmp = null;
|
|
if (!shineDisabled) {
|
|
tmp = null;
|
|
if (c9) {
|
|
let obj = { onLayout: null, style: null, children: null };
|
|
obj[0] = handleLayout;
|
|
const items = [_undefined.shineContainer, closure_11];
|
|
obj[1] = items;
|
|
obj = { style: null, children: null };
|
|
const items1 = [_undefined.shine, _slicedToArray];
|
|
obj[0] = items1;
|
|
obj = { style: null };
|
|
const items2 = [_undefined.shineInner, noop];
|
|
obj[0] = items2;
|
|
obj[1] = callback(outer1_1(shineDisabled[7]).View, obj);
|
|
obj[2] = callback(outer1_1(shineDisabled[7]).View, obj);
|
|
tmp = callback(outer1_1(shineDisabled[7]).View, obj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return tmp;
|
|
};
|
|
return jsx(importDefault(shineDisabled[9]), {});
|
|
};
|