The Select theme can be done using the “Select” polaris component. With options filled with theme names.
Theme list can be listed using the REST API, called from the Remix’s ‘loader’ function :
export const loader = async ({ request }) => {
const { admin, session } = await authenticate.admin(request);
const shopData = await admin.rest.resources.Shop.all({ session: session });
const d= shopData?.data[0].domain;
const themeData = await admin.rest.resources.Theme.all({ session: session });
const themes = themeData?.data;
return json({ domain :d, themes});
};
export default function Index() {
const shopInfos = useLoaderData();
const shopDomain = shopInfos.domain;
const themesArray = shopInfos.themes;
Still cannot detect theme version. How do we know if a theme is compatible with JSON app theme extension ?