import v from "voca"; import { stripIndent } from "common-tags"; import { FileWriter } from "../../base"; import { IFileWriter, TFileWriterConfig } from "../../types"; import { GlobalHelpers } from "../../../helpers"; import { AppConfig } from "../../../../app-config"; class ReactNativeStylesWriter extends FileWriter implements IFileWriter { constructor(protected config: TFileWriterConfig) { super(config); } getFileContent() { let fileContent = ""; const { strategyName } = this.config; if (typeof strategyName === "string") { const componentClassName = v.capitalize(strategyName); fileContent = stripIndent` import {StyleSheet} from "react-native"; //the reason why this is a function, is so that arguments can be supplied in order to make it dynamic - can implement logic for example export const ${componentClassName}Styles=()=>{ return StyleSheet.create({}) }; `; } return fileContent; } execute() { try { this.write("wx"); } catch (error) { GlobalHelpers.showError(error); } } } export { ReactNativeStylesWriter };