From 3980f607049102d6208fbb91f4364d7a8e7115c0 Mon Sep 17 00:00:00 2001 From: Lemuel Smyth <36257395+lemsmyth@users.noreply.github.com> Date: Sat, 12 Feb 2022 10:36:52 -0600 Subject: [PATCH] Enqueue stylesheet (#48) * enqueue admin stylesheet --- admin/css/lbry-admin.css | 10 ++++++++++ classes/LBRY_Admin.php | 15 +++++++++++++++ templates/options-page.php | 8 +++----- 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 admin/css/lbry-admin.css diff --git a/admin/css/lbry-admin.css b/admin/css/lbry-admin.css new file mode 100644 index 0000000..7b261b6 --- /dev/null +++ b/admin/css/lbry-admin.css @@ -0,0 +1,10 @@ +/** + * Stylesheet for the admin options page + * @package LBRYPress + */ + + .wallet-icon-lbc { + height: 1.8em; + margin-right: .5em; + margin-bottom: -.5em; + } \ No newline at end of file diff --git a/classes/LBRY_Admin.php b/classes/LBRY_Admin.php index a715bf4..67c8c1b 100644 --- a/classes/LBRY_Admin.php +++ b/classes/LBRY_Admin.php @@ -33,6 +33,21 @@ class LBRY_Admin array($this, 'options_page_html'), plugin_dir_url(LBRY_PLUGIN_FILE) . '/admin/images/lbry-logo.svg' ); + + // Admin stylesheet enqueue + function load_admin_stylesheet( $hook ) { + + if ( ( $_GET['page'] == 'lbrypress' ) ) { + wp_enqueue_style( + 'lbry-admin', + plugins_url( '/admin/css/lbry-admin.css', LBRY_PLUGIN_FILE ), + array(), + LBRY_VERSION, + 'all' + ); + } + } + add_action( 'admin_enqueue_scripts', 'load_admin_stylesheet' ); } /** diff --git a/templates/options-page.php b/templates/options-page.php index 578453d..ecc5d6a 100644 --- a/templates/options-page.php +++ b/templates/options-page.php @@ -10,20 +10,18 @@ $wallet_balance = $LBRY->daemon->wallet_balance(); $available_balance = $wallet_balance->result->available; $lbry_active_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'general'; $channel_list = $LBRY->daemon->channel_list(); -// TODO: Make this page look cleaner ?>

- -

Wallet Available Balance

+

Wallet Available Balance

@@ -34,7 +32,7 @@ $channel_list = $LBRY->daemon->channel_list(); do_settings_sections( LBRY_ADMIN_PAGE ); submit_button(); } elseif ( $lbry_active_tab == 'channels' ) { -/// include_once( 'partials/channel-page.php' ); + include_once( 'channel-page.php' ); } elseif ( $lbry_active_tab == 'speech' ) { settings_fields( LBRY_SPEECH_SETTINGS ); do_settings_sections( 'lbrypress-speech' );