/*
 * @Author: wangdengzhi
 * @Date: 2020-08-20 16:06:40
 * @Last Modified by: wangdengzhi
 * @Last Modified time: 2020-08-24 09:27:57
 * @description 各个主题相关配置
 */
import { Theme, IThemeConfig } from './types';

const androidConfig: IThemeConfig = {
  type: Theme.Android,
  modalWidth: 1920,
  mindWidth: 1440,
  mindHeight: 1068,
};

const studentConfig: IThemeConfig = {
  type: Theme.Student,
  modalWidth: 960,
  mindWidth: 720,
  mindHeight: 552,
};

const teacherConfig: IThemeConfig = {
  type: Theme.Teacher,
  modalWidth: 960,
  mindWidth: 720,
  mindHeight: 552,
};

class ThemeFactory {
  create(theme): IThemeConfig {
    // 根据webpack打包时定义的变量，提供对应的主题配置
    const currentTheme = theme || webpack_theme;
    switch (currentTheme) {
      case Theme.Student:
        return studentConfig;
      case Theme.Teacher:
        return teacherConfig;
      case Theme.Android:
      default:
        return androidConfig;
    }
  }
}

export default new ThemeFactory();
