Recent advances of covalent organic frameworks in electronic and optical applications