* Adjust search bar to only show hits for News
* Dropdown links working. Working on basic pagination
* Links to articles and temporarily routing to the News search result page working
* Fix colors for search bar and drop down
* Added Lato 300 font weight. Search bar now looks and works like it does on News.
* feat:update styles
* Update client/src/components/search/searchBar/SearchBar.js
Co-Authored-By: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
* Added Lato 300 font weight. Search bar now looks and works like it does on News.
Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
* Added colors from the style guide to :root so they're available globally. Also switched out hex codes for named variables in .dark-palette and .light-palette wherever possible.
* feat: add success and danger colors to root
First on constant variable issue:
This will not compile:
[Plugin(MyPluginName)] // Won't compile because MyPluginName isn't const
[Plugin(MyConstPluginName)] // OK
[Plugin("My Cool Plugin")] // OK
In order to access properties on the static class, it must specify the name of the class before the properties name as proposed on this change:
[Plugin(Variables.MyPluginName)] // Won't compile because MyPluginName isn't const
[Plugin(Variables.MyConstPluginName)] // OK
[Plugin("My Cool Plugin")] // OK
Second on access on attribute properties:
In order to access plugin.Name on this code:
var type = typeof(MyPlugin); // Returns a Type object representing our MyPlugin class
var attributes = System.Attribute.GetCustomAttributes(type); // Returns an Attribute[]
foreach (var a in attributes)
{
if (a is PluginAttribute plugin)
Console.WriteLine($"Plugin Name: {plugin.Name}");
}
You need to cast if first to the right class, then access the properties, as the above code will generate a compile-time error:
var type = typeof(PluginAttribute); // Returns a Type object representing our PluginAttribute class
var attributes = System.Attribute.GetCustomAttributes(type); // Returns an Attribute[]
foreach (var a in attributes)
{
if (a is PluginAttribute)
{
PluginAttribute plug = (PluginAttribute)a; //Cast it first to PluginAttribute class before you can access all accessible properties
Console.WriteLine($"Plugin Name: {plug.Name}");
}
}