コンポーネント整理

This commit is contained in:
harukin-expo-dev-env
2024-03-09 06:39:23 +00:00
parent de37b3698c
commit 45b64f28cb
4 changed files with 54 additions and 73 deletions

View File

@@ -5,7 +5,7 @@ import {
ListWidget,
} from "react-native-android-widget";
export function HelloWidget({ time, delayString }) {
export function TraInfoEXWidget({ time, delayString }) {
return (
<FlexWidget
style={{

View File

@@ -1,11 +1,11 @@
import React from "react";
import { HelloWidget } from "./HelloWidget";
import { TraInfoEXWidget } from "./TraInfoEXWidget";
import dayjs from "dayjs";
import { ToastAndroid } from "react-native";
const nameToWidget = {
// Hello will be the **name** with which we will reference our widget.
JR_shikoku_train_info: HelloWidget,
JR_shikoku_train_info: TraInfoEXWidget,
};
export async function widgetTaskHandler(props) {
@@ -30,25 +30,16 @@ export async function widgetTaskHandler(props) {
switch (props.widgetAction) {
case "WIDGET_ADDED":
case "WIDGET_UPDATE":
// Not needed for now
case "WIDGET_CLICK":
// Not needed for now
case "WIDGET_RESIZED":
// Not needed for now
props.renderWidget(<Widget time={time} delayString={delayString} />);
break;
break;
break;
case "WIDGET_DELETED":
// Not needed for now
break;
break;
default:
break;
}